summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-11-19 20:18:30 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-11-19 20:18:30 +0000
commite1c48b7aaedc5deb6f22ced02dfe4f356bf3f421 (patch)
tree68309d3a28aba2619813c669222d3a6f34763ce9 /libavcodec
parent2867ed9b1c0561b0e50d9c4f73e09621333e2f1f (diff)
use sizeof in snprintf (note the changed code is all under #if 0)
Originally committed as revision 11063 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dvbsubdec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index b51603f30e..d9e44f210d 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -102,7 +102,7 @@ static void png_save2(const char *filename, uint32_t *bitmap, int w, int h)
char fname[40], fname2[40];
char command[1024];
- snprintf(fname, 40, "%s.ppm", filename);
+ snprintf(fname, sizeof(fname), "%s.ppm", filename);
f = fopen(fname, "w");
if (!f) {
@@ -124,7 +124,7 @@ static void png_save2(const char *filename, uint32_t *bitmap, int w, int h)
fclose(f);
- snprintf(fname2, 40, "%s-a.pgm", filename);
+ snprintf(fname2, sizeof(fname2), "%s-a.pgm", filename);
f = fopen(fname2, "w");
if (!f) {
@@ -143,10 +143,10 @@ static void png_save2(const char *filename, uint32_t *bitmap, int w, int h)
}
fclose(f);
- snprintf(command, 1024, "pnmtopng -alpha %s %s > %s.png 2> /dev/null", fname2, fname, filename);
+ snprintf(command, sizeof(command), "pnmtopng -alpha %s %s > %s.png 2> /dev/null", fname2, fname, filename);
system(command);
- snprintf(command, 1024, "rm %s %s", fname, fname2);
+ snprintf(command, sizeof(command), "rm %s %s", fname, fname2);
system(command);
}
#endif
@@ -1262,7 +1262,7 @@ static void save_display_set(DVBSubContext *ctx)
}
- snprintf(filename, 32, "dvbs.%d", fileno_index);
+ snprintf(filename, sizeof(filename), "dvbs.%d", fileno_index);
png_save2(filename, pbuf, width, height);