From: Dan F. <dfa...@us...> - 2008-01-23 22:38:45
|
Update of /cvsroot/libexif/exif/exif In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25229/exif Modified Files: actions.c Log Message: Fixed a compiler warning. Made sure some fixed buffers were NUL-terminated. Made a static table const. Index: actions.c =================================================================== RCS file: /cvsroot/libexif/exif/exif/actions.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -p -d -r1.29 -r1.30 --- actions.c 6 Jan 2008 02:39:54 -0000 1.29 +++ actions.c 23 Jan 2008 22:38:40 -0000 1.30 @@ -1,6 +1,6 @@ /* actions.c * - * Copyright © 2002 Lutz Müller <lu...@us...> + * Copyright © 2002-2008 Lutz Müller <lu...@us...> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -132,9 +132,11 @@ action_mnote_list (const char *filename, } else { p = C (exif_mnote_data_get_title (n, i)); strncpy (b1, p && *p ? p : _("Unknown tag"), bs); + b1[sizeof(b1)-1] = 0; } p = C (exif_mnote_data_get_value (n, i, b, bs)); strncpy (b2, p ? p : _("Unknown value"), bs); + b2[sizeof(b2)-1] = 0; /* printf ("%s|%s\n", b1, b2); */ if (ids) fprintf (stdout, "%-6.6s", b1); @@ -142,7 +144,7 @@ action_mnote_list (const char *filename, fprintf (stdout, "%-20.20s", b1); fputc ('|', stdout); if (ids) { - fputs (CN (b2), stdout); + fputs (b2, stdout); } else { fprintf (stdout, "%-58.58s", b2); } |