9511_project01

project 1 for algorithms & programming I (9511) prof. Cardozo
Index Commits Files Refs README
commit aaedd15c3886bdd4865f0e7c94c289e6db8eb58d
parent 34caea27ae13d5a393f385aa32d37b616f4c3b1a
Author: klewer-martin <martin.cachari@gmail.com>
Date:   Wed, 10 Feb 2021 21:04:09 -0300

Update: fix in read_file.c, now it converts using atoi instead of atol;

Diffstat:
MREADME.md | 7+++++--
Mperrors.h | 2+-
Mread_file.c | 4++--
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
@@ -48,9 +48,12 @@ SYNOPSIS
 
 DESCRIPTION
     Process RAW data from a .csv(comma separated values) file,
-    and export it to another .csv file, if the output file doesn't
+    and export it to a plain text if the output file doesn't
     exist then it creates one with the specified name.
-    When you invoke analisis_covid, expects.. to be continued
+    When you invoke analisis_covid, expects as input a .csv 
+    file with three columns separated by a comma (','), otherwise
+    it's considered corrupt.
+
 
 
 AUTHOR
diff --git a/perrors.h b/perrors.h
@@ -10,7 +10,7 @@
 #define MSG_ERROR_INVOCATING_PROGRAM    "\nERROR_INVOCATING_PROGRAM (2)\n"\
                                         "Usage:\t$ ./main -in <input file> -out <outputfile>\n"\
                                         "\t$ ./main -out <output file -in <input file>\n"\
-                                        "Read documentation to know more"
+                                        "Read README.md to know more"
 
 #define MSG_IO_FILE_NOT_FOUND     "\nIO_FILE_NOT_FOUND (1)\n"\
                                 "Un de los archivos de entrada o salida no se ha especificado"\
diff --git a/read_file.c b/read_file.c
@@ -36,7 +36,7 @@ status_t read_file(FILE *src, uint *country, uint *date, uint *infected)
                 *(country) = atoi(buff2);
             
             else if (data == DATE) 
-                *(date) = atol(buff2);
+                *(date) = atoi(buff2);
             
             data++;
             j = 0;
@@ -47,7 +47,7 @@ status_t read_file(FILE *src, uint *country, uint *date, uint *infected)
                 return ERROR_DATA_ON_FILE_MISSING;
 
             data = PAIS;
-            *(infected) = atol(buff2);
+            *(infected) = atoi(buff2);
             clean_buffer(buff2, SIZE_OF_BUFF2);
         }
             switch(data)