##// END OF EJS Templates
imanay -
r242:243
parent child
Show More
@@ -392,8 +392,6
392 392 else if(strcmp(cmd,"GETF") == 0){
393 393 consigue_nombre_experimento(rx_data,filename1); //get a filename from frame
394 394 tx_data = Lee_experimento(filename1); //return a pointer to the content of the filename
395 printf("%s\n",tx_data);
396 printf("tp1\n");
397 395 }
398 396 else if(strcmp(cmd,"CHGB") == 0){
399 397 cambia_apuntamiento(rx_data);
@@ -443,7 +441,6
443 441 strcat(tx_buffer,cmd); //4
444 442 strcat(tx_buffer,tx_data); //?
445 443 strcat(tx_buffer,crc); //1
446
447 444 }
448 445
449 446 }
@@ -455,11 +452,14
455 452 fseek(fd, 0, SEEK_END);
456 453 size_t sz = ftell(fd);
457 454 fseek(fd, 0, SEEK_SET);
458 buffer = malloc(sz + 1);
455 buffer = malloc(sz);
459 456 fread(buffer,sizeof(char),sz,fd);
460 buffer[sz] = '\0';
461 457 fclose(fd);
462 return buffer;
458
459 char *ans = malloc(sz + 1);
460 strcpy(ans, buffer);
461 ans[sz] = '\0';
462 return ans;
463 463 }
464 464 /*
465 465 * Esta función genera el archivo de experimento a partir de la trama TCP recibida
General Comments 0
You need to be logged in to leave comments. Login now