From 61950877ad3484ed153860e6756d0bd9f54a6c5c Mon Sep 17 00:00:00 2001 From: Eddie Kohler Date: Wed, 30 Aug 2023 08:33:36 -0400 Subject: [PATCH] Snprintf fix. --- configure.ac | 4 ++-- include/lcdf/clp.h | 2 +- include/lcdfgif/gifx.h | 2 +- src/clp.c | 2 +- src/gifdiff.c | 4 ++-- src/gifread.c | 2 +- src/gifsicle.c | 4 ++-- src/giftoc.c | 2 +- src/gifunopt.c | 2 +- src/gifview.c | 4 ++-- src/gifwrite.c | 2 +- src/gifx.c | 2 +- src/quantize.c | 2 +- src/support.c | 2 +- src/ungifwrt.c | 2 +- src/xform.c | 2 +- 16 files changed, 20 insertions(+), 20 deletions(-) diff --git a/configure.ac b/configure.ac index 82e4748..2ff132c 100644 --- a/configure.ac +++ b/configure.ac @@ -294,12 +294,12 @@ char *strerror(int errno); /* Need _setmode under MS-DOS, to set stdin/stdout to binary mode */ /* Need _fsetmode under OS/2 for the same reason */ -/* Windows has _isatty and _snprintf, not the normal versions */ +/* Windows has _isatty, not isatty */ +/* Modern Windows has _snprintf, but we prefer snprintf */ #if defined(_MSDOS) || defined(_WIN32) || defined(__EMX__) || defined(__DJGPP__) # include # include # define isatty _isatty -# define snprintf _snprintf #endif #ifndef HAVE_SNPRINTF diff --git a/include/lcdf/clp.h b/include/lcdf/clp.h index a3126b7..f816c77 100644 --- a/include/lcdf/clp.h +++ b/include/lcdf/clp.h @@ -8,7 +8,7 @@ extern "C" { /* clp.h - Public interface to CLP. * This file is part of CLP, the command line parser package. * - * Copyright (c) 1997-2021 Eddie Kohler, ekohler@gmail.com + * Copyright (c) 1997-2023 Eddie Kohler, ekohler@gmail.com * * CLP is free software. It is distributed under the GNU General Public * License, Version 2, or, alternatively and at your discretion, under the diff --git a/include/lcdfgif/gifx.h b/include/lcdfgif/gifx.h index 6699775..6d4573e 100644 --- a/include/lcdfgif/gifx.h +++ b/include/lcdfgif/gifx.h @@ -6,7 +6,7 @@ extern "C" { #endif /* gifx.h - Functions to turn GIFs in memory into X Pixmaps. - Copyright (C) 1997-2021 Eddie Kohler, ekohler@gmail.com + Copyright (C) 1997-2023 Eddie Kohler, ekohler@gmail.com This file is part of the LCDF GIF library. The LCDF GIF library is free software*. It is distributed under the GNU diff --git a/src/clp.c b/src/clp.c index a79524f..c732ef9 100644 --- a/src/clp.c +++ b/src/clp.c @@ -2,7 +2,7 @@ /* clp.c - Complete source code for CLP. * This file is part of CLP, the command line parser package. * - * Copyright (c) 1997-2021 Eddie Kohler, ekohler@gmail.com + * Copyright (c) 1997-2023 Eddie Kohler, ekohler@gmail.com * * CLP is free software. It is distributed under the GNU General Public * License, Version 2, or, alternatively and at your discretion, under the diff --git a/src/gifdiff.c b/src/gifdiff.c index 13f0a4f..998b9b5 100644 --- a/src/gifdiff.c +++ b/src/gifdiff.c @@ -1,5 +1,5 @@ /* gifdiff.c - Gifdiff compares GIF images for identical appearance. - Copyright (C) 1998-2021 Eddie Kohler, ekohler@gmail.com + Copyright (C) 1998-2023 Eddie Kohler, ekohler@gmail.com This file is part of gifdiff, in the gifsicle package. Gifdiff is free software. It is distributed under the GNU Public License, @@ -560,7 +560,7 @@ main(int argc, char *argv[]) case VERSION_OPT: printf("gifdiff (LCDF Gifsicle) %s\n", VERSION); - printf("Copyright (C) 1998-2021 Eddie Kohler\n\ + printf("Copyright (C) 1998-2023 Eddie Kohler\n\ This is free software; see the source for copying conditions.\n\ There is NO warranty, not even for merchantability or fitness for a\n\ particular purpose.\n"); diff --git a/src/gifread.c b/src/gifread.c index 6ef6f3f..f45a0dc 100644 --- a/src/gifread.c +++ b/src/gifread.c @@ -1,5 +1,5 @@ /* gifread.c - Functions to read GIFs. - Copyright (C) 1997-2021 Eddie Kohler, ekohler@gmail.com + Copyright (C) 1997-2023 Eddie Kohler, ekohler@gmail.com This file is part of the LCDF GIF library. The LCDF GIF library is free software. It is distributed under the GNU diff --git a/src/gifsicle.c b/src/gifsicle.c index c01a8aa..c7836e6 100644 --- a/src/gifsicle.c +++ b/src/gifsicle.c @@ -1,6 +1,6 @@ /* -*- c-basic-offset: 2 -*- */ /* gifsicle.c - gifsicle's main loop. - Copyright (C) 1997-2021 Eddie Kohler, ekohler@gmail.com + Copyright (C) 1997-2023 Eddie Kohler, ekohler@gmail.com This file is part of gifsicle. Gifsicle is free software. It is distributed under the GNU Public License, @@ -2126,7 +2126,7 @@ main(int argc, char *argv[]) #else printf("LCDF Gifsicle %s\n", VERSION); #endif - printf("Copyright (C) 1997-2021 Eddie Kohler\n\ + printf("Copyright (C) 1997-2023 Eddie Kohler\n\ This is free software; see the source for copying conditions.\n\ There is NO warranty, not even for merchantability or fitness for a\n\ particular purpose.\n"); diff --git a/src/giftoc.c b/src/giftoc.c index dcf540f..2f5faec 100644 --- a/src/giftoc.c +++ b/src/giftoc.c @@ -154,7 +154,7 @@ main(int argc, char *argv[]) && directory[0]) { size_t len = strlen(directory) + 2; char *ndirectory = (char *)fmalloc(len); - sprintf(ndirectory, len, "%s%c", directory, PATHNAME_SEPARATOR); + snprintf(ndirectory, len, "%s%c", directory, PATHNAME_SEPARATOR); directory = ndirectory; } } else diff --git a/src/gifunopt.c b/src/gifunopt.c index f4460d0..6224a46 100644 --- a/src/gifunopt.c +++ b/src/gifunopt.c @@ -1,5 +1,5 @@ /* gifunopt.c - Unoptimization function for the GIF library. - Copyright (C) 1997-2021 Eddie Kohler, ekohler@gmail.com + Copyright (C) 1997-2023 Eddie Kohler, ekohler@gmail.com This file is part of the LCDF GIF library. The LCDF GIF library is free software. It is distributed under the GNU diff --git a/src/gifview.c b/src/gifview.c index 18018ee..e9ab257 100644 --- a/src/gifview.c +++ b/src/gifview.c @@ -1,5 +1,5 @@ /* gifview.c - gifview's main loop. - Copyright (C) 1997-2021 Eddie Kohler, ekohler@gmail.com + Copyright (C) 1997-2023 Eddie Kohler, ekohler@gmail.com This file is part of gifview, in the gifsicle package. Gifview is free software. It is distributed under the GNU Public License, @@ -1356,7 +1356,7 @@ main(int argc, char *argv[]) case VERSION_OPT: printf("gifview (LCDF Gifsicle) %s\n", VERSION); - printf("Copyright (C) 1997-2021 Eddie Kohler\n\ + printf("Copyright (C) 1997-2023 Eddie Kohler\n\ This is free software; see the source for copying conditions.\n\ There is NO warranty, not even for merchantability or fitness for a\n\ particular purpose.\n"); diff --git a/src/gifwrite.c b/src/gifwrite.c index f262a5f..115f2c8 100644 --- a/src/gifwrite.c +++ b/src/gifwrite.c @@ -1,6 +1,6 @@ /* -*- mode: c; c-basic-offset: 2 -*- */ /* gifwrite.c - Functions to write GIFs. - Copyright (C) 1997-2021 Eddie Kohler, ekohler@gmail.com + Copyright (C) 1997-2023 Eddie Kohler, ekohler@gmail.com This file is part of the LCDF GIF library. The LCDF GIF library is free software. It is distributed under the GNU diff --git a/src/gifx.c b/src/gifx.c index eed7deb..1e4cab2 100644 --- a/src/gifx.c +++ b/src/gifx.c @@ -1,5 +1,5 @@ /* gifx.c - Functions to turn GIFs in memory into X Pixmaps. - Copyright (C) 1997-2021 Eddie Kohler, ekohler@gmail.com + Copyright (C) 1997-2023 Eddie Kohler, ekohler@gmail.com This file is part of the LCDF GIF library. The LCDF GIF library is free software. It is distributed under the GNU diff --git a/src/quantize.c b/src/quantize.c index 25fd127..185fc4c 100644 --- a/src/quantize.c +++ b/src/quantize.c @@ -1,5 +1,5 @@ /* quantize.c - Histograms and quantization for gifsicle. - Copyright (C) 1997-2021 Eddie Kohler, ekohler@gmail.com + Copyright (C) 1997-2023 Eddie Kohler, ekohler@gmail.com This file is part of gifsicle. Gifsicle is free software. It is distributed under the GNU Public License, diff --git a/src/support.c b/src/support.c index 0b5543d..94997b1 100644 --- a/src/support.c +++ b/src/support.c @@ -1,5 +1,5 @@ /* support.c - Support functions for gifsicle. - Copyright (C) 1997-2021 Eddie Kohler, ekohler@gmail.com + Copyright (C) 1997-2023 Eddie Kohler, ekohler@gmail.com This file is part of gifsicle. Gifsicle is free software. It is distributed under the GNU Public License, diff --git a/src/ungifwrt.c b/src/ungifwrt.c index 2f4098e..f5c65bd 100644 --- a/src/ungifwrt.c +++ b/src/ungifwrt.c @@ -2,7 +2,7 @@ /* ungifwrt.c - Functions to write unGIFs -- GIFs with run-length compression, not LZW compression. Idea due to Hutchinson Avenue Software Corporation . - Copyright (C) 1997-2021 Eddie Kohler, ekohler@gmail.com + Copyright (C) 1997-2023 Eddie Kohler, ekohler@gmail.com This file is part of the LCDF GIF library. The LCDF GIF library is free software. It is distributed under the GNU diff --git a/src/xform.c b/src/xform.c index e26198c..8fdcf88 100644 --- a/src/xform.c +++ b/src/xform.c @@ -1,5 +1,5 @@ /* xform.c - Image transformation functions for gifsicle. - Copyright (C) 1997-2021 Eddie Kohler, ekohler@gmail.com + Copyright (C) 1997-2023 Eddie Kohler, ekohler@gmail.com This file is part of gifsicle. Gifsicle is free software. It is distributed under the GNU Public License,