openbsd-ports/graphics/jhead/patches/patch-gpsinfo_c
benoit c95c3c67ae - update jhead to 2.87
- update & regen patches

ok ajacoutot@, okan@
2009-10-01 20:20:23 +00:00

28 lines
1.1 KiB
Plaintext

$OpenBSD: patch-gpsinfo_c,v 1.4 2009/10/01 20:20:27 benoit Exp $
--- gpsinfo.c.orig Mon Mar 2 08:34:10 2009
+++ gpsinfo.c Wed Sep 30 16:49:45 2009
@@ -145,9 +145,10 @@ void ProcessGpsInfo(unsigned char * DirStart, int Byte
FmtString[3+a*7] = (char)('0'+digits);
Values[a] = ConvertAnyFormat(ValuePtr+a*ComponentSize, Format);
- }
+ }
- sprintf(TempString, FmtString, Values[0], Values[1], Values[2]);
+ snprintf(TempString, sizeof(TempString),
+ FmtString, Values[0], Values[1], Values[2]);
if (Tag == TAG_GPS_LAT){
strncpy(ImageInfo.GpsLat+2, TempString, 29);
@@ -161,8 +162,8 @@ void ProcessGpsInfo(unsigned char * DirStart, int Byte
break;
case TAG_GPS_ALT:
- sprintf(ImageInfo.GpsAlt + 1, "%.2fm",
- ConvertAnyFormat(ValuePtr, Format));
+ snprintf(ImageInfo.GpsAlt + 1, sizeof(ImageInfo.GpsAlt) + 1,
+ "%dm", Get32s(ValuePtr));
break;
}