@@ -392,8 +392,6 | |||||
392 | else if(strcmp(cmd,"GETF") == 0){ |
|
392 | else if(strcmp(cmd,"GETF") == 0){ | |
393 | consigue_nombre_experimento(rx_data,filename1); //get a filename from frame |
|
393 | consigue_nombre_experimento(rx_data,filename1); //get a filename from frame | |
394 | tx_data = Lee_experimento(filename1); //return a pointer to the content of the filename |
|
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 | else if(strcmp(cmd,"CHGB") == 0){ |
|
396 | else if(strcmp(cmd,"CHGB") == 0){ | |
399 | cambia_apuntamiento(rx_data); |
|
397 | cambia_apuntamiento(rx_data); | |
@@ -443,7 +441,6 | |||||
443 | strcat(tx_buffer,cmd); //4 |
|
441 | strcat(tx_buffer,cmd); //4 | |
444 | strcat(tx_buffer,tx_data); //? |
|
442 | strcat(tx_buffer,tx_data); //? | |
445 | strcat(tx_buffer,crc); //1 |
|
443 | strcat(tx_buffer,crc); //1 | |
446 |
|
||||
447 | } |
|
444 | } | |
448 |
|
445 | |||
449 | } |
|
446 | } | |
@@ -455,11 +452,14 | |||||
455 | fseek(fd, 0, SEEK_END); |
|
452 | fseek(fd, 0, SEEK_END); | |
456 | size_t sz = ftell(fd); |
|
453 | size_t sz = ftell(fd); | |
457 | fseek(fd, 0, SEEK_SET); |
|
454 | fseek(fd, 0, SEEK_SET); | |
458 |
buffer = malloc(sz |
|
455 | buffer = malloc(sz); | |
459 | fread(buffer,sizeof(char),sz,fd); |
|
456 | fread(buffer,sizeof(char),sz,fd); | |
460 | buffer[sz] = '\0'; |
|
|||
461 | fclose(fd); |
|
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 | * Esta función genera el archivo de experimento a partir de la trama TCP recibida |
|
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