Update of /cvsroot/libexif/libexif/libexif
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25921
Modified Files:
exif-content.c exif.c
Log Message:
Used splint:
- replaced some sprintf-calls with snprintf (and appropriate size value)
- eliminated some unused variables
splint still complains about a lot of signedness errors (comparisons and assignments),
will do more checks soon
Index: exif.c
===================================================================
RCS file: /cvsroot/libexif/libexif/libexif/exif.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -d -r1.3 -r1.4
--- exif.c 15 Dec 2002 11:41:11 -0000 1.3
+++ exif.c 19 Mar 2006 17:23:06 -0000 1.4
@@ -626,7 +626,7 @@ ProcessAperture(ImageInfoType *ImageInfo
if (exif_find_record(ImageInfo->d, "FNumber") == NULL) {
/* Convert aperture to F-stop. */
fstop = pow(sqrt(2), ((double)rd.r.num)/((double)rd.r.denom));
- sprintf(label, "f%.1g", fstop);
+ snprintf(label,32, "f%.1g", fstop);
rd.s = strdup(label);
exif_append_data(&ImageInfo->d,
"FNumber",
@@ -673,7 +673,7 @@ ProcessCanonMakerNote(ImageInfoType *Ima
rec_type = ConvertAnyFormat2(OffsetPtr, ByteCount, format,
ImageInfo->MotorolaOrder,
&rd);
- sprintf(label, "MakerNote%04x", tag);
+ snprintf(label, 32, "MakerNote%04x", tag);
exif_append_data(&ImageInfo->d,
label,
rec_type,
@@ -819,11 +819,10 @@ static int
ProcessExifDir(ImageInfoType *ImageInfo, char *DirStart, char *OffsetBase, unsigned ExifLength, char *LastExifRefd)
{
int de;
- int a;
int NumDirEntries;
exif_rec_data_t rd;
- char rec_type;
- char label[32];
+ char rec_type;
+ char label[32];
NumDirEntries = Get16u(DirStart, ImageInfo->MotorolaOrder);
@@ -912,7 +911,7 @@ ProcessExifDir(ImageInfoType *ImageInfo,
rec_type = ConvertAnyFormat2(ValuePtr, ByteCount, Format,
ImageInfo->MotorolaOrder,
&rd);
- sprintf(label, "0x%04x", Tag);
+ snprintf(label, 32, "0x%04x", Tag);
exif_append_data(&ImageInfo->d,
label,
rec_type,
@@ -931,7 +930,6 @@ static int
process_EXIF (ImageInfoType *ImageInfo, char *CharBuf, unsigned int length, char *LastExifRefd)
{
int cc;
- exif_rec_data_t rd;
LastExifRefd = CharBuf;
{ /* Check the EXIF header component */
@@ -1127,9 +1125,6 @@ ReadJpegFile(ImageInfoType *ImageInfo, S
{
FILE *infile;
int ret;
- char *tmp;
- char **p_argv;
- int p_argc;
infile = fdopen(fd, "rb"); /* Unix ignores 'b', windows needs it. */
@@ -1163,7 +1158,6 @@ read_jpeg_exif(ImageInfoType *ImageInfo,
int SectionsRead;
char *LastExifRefd=NULL;
int ret;
- int thumbsize=0;
ret = ReadJpegFile(ImageInfo, Sections, &SectionsRead, fd, ReadAll, LastExifRefd);
#if 0
Index: exif-content.c
===================================================================
RCS file: /cvsroot/libexif/libexif/libexif/exif-content.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -p -d -r1.18 -r1.19
--- exif-content.c 30 Apr 2005 00:55:28 -0000 1.18
+++ exif-content.c 19 Mar 2006 17:23:06 -0000 1.19
@@ -122,7 +122,7 @@ exif_content_dump (ExifContent *content,
if (!content)
return;
- printf ("%sDumping exif content (%i entries)...\n", buf,
+ printf ("%sDumping exif content (%u entries)...\n", buf,
content->count);
for (i = 0; i < content->count; i++)
exif_entry_dump (content->entries[i], indent + 1);
|