From: Jan P. <pa...@pi...> - 2008-07-27 08:50:12
|
Hi, > Modified Files: > exif-tag.c > Log Message: > gracefully return 0 when the name has not been found ..... > exif_tag_from_name (const char *name) > { > unsigned int i; > + unsigned int result=0; > > if (!name) return 0; > > for (i = 0; ExifTagTable[i].name; i++) > - if (!strcmp (ExifTagTable[i].name, name)) break; > - return ExifTagTable[i].tag; I am curious - did the old code really behave differently than the new one? If the name is not found, at the end ExifTagTable[i].name is NULL and therefore also ExifTagTable[i].tag is NULL. Or am I overlooking something? -- Jan > + if (!strcmp (ExifTagTable[i].name, name)) { > + result = ExifTagTable[i].tag; > + break; > + } > + return result; > } |