tiff/doubles2str: check for truncation

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-09-09 14:41:18 +02:00
parent 0196bc6f14
commit 17f9626b5d

View File

@ -215,7 +215,9 @@ static char *doubles2str(double *dp, int count, const char *sep)
ap0 = ap;
ap[0] = '\0';
for (i = 0; i < count; i++) {
int l = snprintf(ap, component_len, "%f%s", dp[i], sep);
unsigned l = snprintf(ap, component_len, "%f%s", dp[i], sep);
if(l >= component_len)
return NULL;
ap += l;
}
ap0[strlen(ap0) - strlen(sep)] = '\0';