From: Jaakko H. <jhe...@us...> - 2006-08-26 18:17:19
|
Update of /cvsroot/abook/abook In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv24204 Modified Files: TODO edit.c Log Message: * clean up ISO 8601 string generation * atoi() -> safe_atoi() Index: edit.c =================================================================== RCS file: /cvsroot/abook/abook/edit.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- edit.c 25 Aug 2006 22:51:01 -0000 1.50 +++ edit.c 26 Aug 2006 18:17:14 -0000 1.51 @@ -251,9 +251,12 @@ strncpy(buf, str, sizeof(buf)); if(str && parse_date_string(buf, &day, &month, &year)) { - str = strdup_printf(year ? " %04d-%02d-%02d" : - "%c%02d-%02d", year ? year : ' ', - month, day); + if(year) + str = strdup_printf("%04d-%02d-%02d", + year, month, day); + else + str = strdup_printf("--%02d-%02d", + month, day); mvwaddnstr(editw, y, TAB_COLON_POS + 2, str, bytes2width(str, FIELD_MAX_WIDTH)); free(str); @@ -440,8 +443,8 @@ return FALSE; *s++ = '\0'; switch(i) { - case 1: *year = atoi(p); break; - case 2: *month = atoi(p); break; + case 1: *year = safe_atoi(p); break; + case 2: *month = safe_atoi(p); break; } p = s; } else Index: TODO =================================================================== RCS file: /cvsroot/abook/abook/TODO,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- TODO 25 Aug 2006 10:17:21 -0000 1.9 +++ TODO 26 Aug 2006 18:17:14 -0000 1.10 @@ -1,6 +1,3 @@ -0.6 - - input for day type should be implemented - generic: - grouping - new file format (xml?) |