Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package iceauth for openSUSE:Factory checked in at 2024-03-13 22:16:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/iceauth (Old) and /work/SRC/openSUSE:Factory/.iceauth.new.1770 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "iceauth" Wed Mar 13 22:16:22 2024 rev:11 rq:1156809 version:1.0.10 Changes: -------- --- /work/SRC/openSUSE:Factory/iceauth/iceauth.changes 2022-04-05 19:55:48.765993210 +0200 +++ /work/SRC/openSUSE:Factory/.iceauth.new.1770/iceauth.changes 2024-03-13 22:16:41.656112572 +0100 @@ -1,0 +2,6 @@ +Mon Mar 11 01:36:19 UTC 2024 - Stefan Dirsch <[email protected]> + +- Update to version 1.0.10 + * minor bugfix release, including fixes for compiler warnings + +------------------------------------------------------------------- Old: ---- iceauth-1.0.9.tar.xz New: ---- iceauth-1.0.10.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ iceauth.spec ++++++ --- /var/tmp/diff_new_pack.TB1kaX/_old 2024-03-13 22:16:42.156130966 +0100 +++ /var/tmp/diff_new_pack.TB1kaX/_new 2024-03-13 22:16:42.156130966 +0100 @@ -1,7 +1,7 @@ # # spec file for package iceauth # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: iceauth -Version: 1.0.9 +Version: 1.0.10 Release: 0 Summary: Utility to edit and display the ICE authorization information License: MIT ++++++ iceauth-1.0.9.tar.xz -> iceauth-1.0.10.tar.xz ++++++ ++++ 9035 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/iceauth-1.0.9/ChangeLog new/iceauth-1.0.10/ChangeLog --- old/iceauth-1.0.9/ChangeLog 2022-04-03 20:46:46.000000000 +0200 +++ new/iceauth-1.0.10/ChangeLog 2024-03-10 22:52:50.000000000 +0100 @@ -1,3 +1,85 @@ +commit 14e122c85b9fba7100b1bdc11abdb9b939d59254 +Author: Alan Coopersmith <[email protected]> +Date: Sun Mar 10 14:48:50 2024 -0700 + + iceauth 1.0.10 + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 51a526dbe4fe4586b6e35a018c7c9b9e1ad36a8a +Author: Alan Coopersmith <[email protected]> +Date: Sat Feb 17 11:05:16 2024 -0800 + + unifdef __UNIXOS2__ + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 29e22b4199f3b0fb4044a8026664951e5aab4700 +Author: Alan Coopersmith <[email protected]> +Date: Sat Feb 3 12:12:21 2024 -0800 + + Variable scope reductions, as suggested by cppcheck + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 43da1a3b78fbe0afc5db4a89fa8f72d3b5f7b91a +Author: Alan Coopersmith <[email protected]> +Date: Sat Feb 3 11:22:53 2024 -0800 + + Silence -Wanalyzer-out-of-bounds warnings from gcc 13 + + Analyzer seems not to realize that the last allocated argv entry + should always be set to NULL, causing the || to stop checking argv + entries before getting to any that are not allocated. Raising our + minimum allocation from 4 pointers to 6 soothes it, and costs us + basically nothing. + + process.c:1285:26: warning: heap-based buffer over-read [CWE-126] [-Wanalyzer-out-of-bounds] + 1285 | !argv[3] || !argv[4] || !argv[5]) + | ~~~~^~~ + [...] + process.c:1285:26: note: read of 8 bytes from after the end of the region + 1285 | !argv[3] || !argv[4] || !argv[5]) + | ~~~~^~~ + process.c:1285:38: warning: heap-based buffer over-read [CWE-126] [-Wanalyzer-out-of-bounds] + 1285 | !argv[3] || !argv[4] || !argv[5]) + | ~~~~^~~ + [...] + process.c:1285:38: note: read of 8 bytes from after the end of the region + 1285 | !argv[3] || !argv[4] || !argv[5]) + | ~~~~^~~ + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 16ace290b2e6d261db21b60bf6ab7c074b112569 +Author: Alan Coopersmith <[email protected]> +Date: Sat Feb 3 11:20:19 2024 -0800 + + Use reallocarray if available, provide local version if not + + Based on similar commits to xauth + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit ba4c183d8721f3ef086fb1d15881bb9aeeb4ecd4 +Author: Alan Coopersmith <[email protected]> +Date: Wed Feb 8 11:57:44 2023 -0800 + + configure: Use AC_SYS_LARGEFILE to enable large file support + + While .ICEauthority files should never be more than 2gb in size, + they may be stored on filesystems with large inodes. + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 0ea496769469da48aebce7d95b79b4db373cda24 +Author: Alan Coopersmith <[email protected]> +Date: Thu Jul 28 17:30:21 2022 -0700 + + gitlab CI: stop requiring Signed-off-by in commits + + Signed-off-by: Alan Coopersmith <[email protected]> + commit 82ef227485f6d102beae907212b4e903a05110e6 Author: Alan Coopersmith <[email protected]> Date: Sun Apr 3 11:41:21 2022 -0700 @@ -828,7 +910,7 @@ 4496504) commit d0bc63cf13e98f686bd371a0ab609018e7fdf8c2 -Author: Søren Sandmann Pedersen <[email protected]> +Author: Søren Sandmann Pedersen <[email protected]> Date: Tue Jun 28 15:04:15 2005 +0000 Add build system for iceauth diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/iceauth-1.0.9/config.h.in new/iceauth-1.0.10/config.h.in --- old/iceauth-1.0.9/config.h.in 2022-04-03 20:46:41.000000000 +0200 +++ new/iceauth-1.0.10/config.h.in 2024-03-10 22:52:44.000000000 +0100 @@ -3,6 +3,12 @@ /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the <minix/config.h> header file. */ +#undef HAVE_MINIX_CONFIG_H + +/* Define to 1 if you have the 'reallocarray' function. */ +#undef HAVE_REALLOCARRAY + /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H @@ -27,6 +33,9 @@ /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H +/* Define to 1 if you have the <wchar.h> header file. */ +#undef HAVE_WCHAR_H + /* Name of package */ #undef PACKAGE @@ -57,10 +66,114 @@ /* Patch version of this package */ #undef PACKAGE_VERSION_PATCHLEVEL -/* Define to 1 if all of the C90 standard headers exist (not just the ones +/* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS +/* Enable extensions on AIX, Interix, z/OS. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable general extensions on macOS. */ +#ifndef _DARWIN_C_SOURCE +# undef _DARWIN_C_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable X/Open compliant socket functions that do not require linking + with -lxnet on HP-UX 11.11. */ +#ifndef _HPUX_ALT_XOPEN_SOCKET_API +# undef _HPUX_ALT_XOPEN_SOCKET_API +#endif +/* Identify the host operating system as Minix. + This macro does not affect the system headers' behavior. + A future release of Autoconf may stop defining this macro. */ +#ifndef _MINIX +# undef _MINIX +#endif +/* Enable general extensions on NetBSD. + Enable NetBSD compatibility extensions on Minix. */ +#ifndef _NETBSD_SOURCE +# undef _NETBSD_SOURCE +#endif +/* Enable OpenBSD compatibility extensions on NetBSD. + Oddly enough, this does nothing on OpenBSD. */ +#ifndef _OPENBSD_SOURCE +# undef _OPENBSD_SOURCE +#endif +/* Define to 1 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_SOURCE +# undef _POSIX_SOURCE +#endif +/* Define to 2 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_1_SOURCE +# undef _POSIX_1_SOURCE +#endif +/* Enable POSIX-compatible threading on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# undef __STDC_WANT_IEC_60559_BFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# undef __STDC_WANT_IEC_60559_DFP_EXT__ +#endif +/* Enable extensions specified by C23 Annex F. */ +#ifndef __STDC_WANT_IEC_60559_EXT__ +# undef __STDC_WANT_IEC_60559_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# undef __STDC_WANT_IEC_60559_FUNCS_EXT__ +#endif +/* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# undef __STDC_WANT_IEC_60559_TYPES_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# undef __STDC_WANT_LIB_EXT2__ +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# undef __STDC_WANT_MATH_SPEC_FUNCS__ +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable X/Open extensions. Define to 500 only if necessary + to make mbstate_t available. */ +#ifndef _XOPEN_SOURCE +# undef _XOPEN_SOURCE +#endif + + /* Version number of package */ #undef VERSION + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define to 1 on platforms where this makes off_t a 64-bit type. */ +#undef _LARGE_FILES + +/* Number of bits in time_t, on hosts where this is settable. */ +#undef _TIME_BITS + +/* Define to 1 on platforms where this makes time_t a 64-bit type. */ +#undef __MINGW_USE_VC2005_COMPAT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/iceauth-1.0.9/configure.ac new/iceauth-1.0.10/configure.ac --- old/iceauth-1.0.9/configure.ac 2022-04-03 20:46:37.000000000 +0200 +++ new/iceauth-1.0.10/configure.ac 2024-03-10 22:52:40.000000000 +0100 @@ -22,12 +22,17 @@ dnl Process this file with autoconf to create configure. # Initialize Autoconf -AC_PREREQ([2.60]) -AC_INIT([iceauth], [1.0.9], - [https://gitlab.freedesktop.org/xorg/app/iceauth/issues], [iceauth]) +AC_PREREQ([2.70]) +AC_INIT([iceauth], [1.0.10], + [https://gitlab.freedesktop.org/xorg/app/iceauth/-/issues], [iceauth]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) +# Set common system defines for POSIX extensions, such as _GNU_SOURCE +# Must be called before any macros that run the compiler (like +# AC_PROG_LIBTOOL) to avoid autoconf errors. +AC_USE_SYSTEM_EXTENSIONS + # Initialize Automake AM_INIT_AUTOMAKE([foreign dist-xz]) @@ -37,6 +42,12 @@ XORG_MACROS_VERSION(1.8) XORG_DEFAULT_OPTIONS +# Checks for typedefs, structures, and compiler characteristics. +AC_SYS_LARGEFILE + +# Checks for library functions. +AC_CHECK_FUNCS([reallocarray]) + # Checks for pkg-config packages PKG_CHECK_MODULES(ICEAUTH, [xproto >= 7.0.22 ice]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/iceauth-1.0.9/iceauth.c new/iceauth-1.0.10/iceauth.c --- old/iceauth-1.0.9/iceauth.c 2022-04-03 20:46:37.000000000 +0200 +++ new/iceauth-1.0.10/iceauth.c 2024-03-10 22:52:40.000000000 +0100 @@ -85,7 +85,6 @@ int main (int argc, char *argv[]) { - int i; const char *sourcename = defsource; const char **arglist = defcmds; int nargs = ndefcmds; @@ -93,13 +92,11 @@ ProgramName = argv[0]; - for (i = 1; i < argc; i++) { + for (int i = 1; i < argc; i++) { const char *arg = argv[i]; if (arg[0] == '-') { - const char *flag; - - for (flag = (arg + 1); *flag; flag++) { + for (const char *flag = (arg + 1); *flag; flag++) { switch (*flag) { case 'f': /* -f authfilename */ if (++i >= argc) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/iceauth-1.0.9/process.c new/iceauth-1.0.10/process.c --- old/iceauth-1.0.9/process.c 2022-04-03 20:46:37.000000000 +0200 +++ new/iceauth-1.0.10/process.c 2024-03-10 22:52:40.000000000 +0100 @@ -270,17 +270,28 @@ return s; } +#ifndef HAVE_REALLOCARRAY +static inline void * +reallocarray(void *optr, size_t nmemb, size_t size) +{ + if ((nmemb > 0) && (SIZE_MAX / nmemb < size)) { + errno = ENOMEM; + return NULL; + } + return realloc(optr, size * nmemb); +} +#endif + static char **split_into_words ( /* argvify string */ char *src, int *argcp) { char *jword; - char savec; char **argv; int cur, total; *argcp = 0; -#define WORDSTOALLOC 4 /* most lines are short */ +#define WORDSTOALLOC 6 /* most lines are short */ argv = (char **) malloc (WORDSTOALLOC * sizeof (char *)); if (!argv) return NULL; cur = 0; @@ -293,6 +304,8 @@ */ do { + char savec; + jword = skip_space (src); src = skip_nonspace (jword); savec = *src; @@ -300,7 +313,7 @@ if (cur == total) { char **prevargv = argv; total += WORDSTOALLOC; - argv = (char **) realloc (argv, total * sizeof (char *)); + argv = reallocarray (argv, total, sizeof (char *)); if (!argv) { free (prevargv); return NULL; @@ -393,13 +406,11 @@ unsigned int i; unsigned int len = 0; char *retval; - const char *s; unsigned char *us; - char c; char savec = '\0'; /* count */ - for (s = hexstr; *s; s++) { + for (const char *s = hexstr; *s; s++) { if (!isascii(*s)) return -1; if (isspace(*s)) continue; if (!isxdigit(*s)) return -1; @@ -420,7 +431,8 @@ } for (us = (unsigned char *) retval, i = len; i > 0; hexstr++) { - c = *hexstr; + char c = *hexstr; + if (isspace(c)) continue; /* already know it is ascii */ if (isupper(c)) c = tolower(c); @@ -447,13 +459,12 @@ const CommandTable *tab, int *statusp) { - const CommandTable *ct; const char *cmd; size_t n; /* scan table for command */ cmd = argv[0]; n = strlen (cmd); - for (ct = tab; ct->name; ct++) { + for (const CommandTable *ct = tab; ct->name; ct++) { /* look for unique prefix */ if (n >= ct->minlen && n <= ct->maxlen && strncmp (cmd, ct->name, n) == 0) { @@ -521,7 +532,6 @@ int auth_initialize ( char *authfilename ) { int n; - AuthList *head, *tail; FILE *authfp; Bool exists; @@ -598,6 +608,8 @@ "%s: creating new authority file %s\n", ProgramName, authfilename); } else { + AuthList *head, *tail; + iceauth_existed = True; n = read_auth_entries (authfp, &head, &tail); (void) fclose (authfp); @@ -622,7 +634,6 @@ static int write_auth_file (char *tmp_nam, size_t tmp_nam_len) { FILE *fp; - AuthList *list; if ((strlen(iceauth_filename) + 3) > tmp_nam_len) { strncpy(tmp_nam, "filename too long", tmp_nam_len); @@ -640,8 +651,9 @@ return -1; } - for (list = iceauth_head; list; list = list->next) + for (AuthList *list = iceauth_head; list; list = list->next) { IceWriteAuthFileEntry (fp, list->auth); + } (void) fclose (fp); return 0; @@ -649,8 +661,6 @@ int auth_finalize (void) { - char temp_name[1024]; /* large filename size */ - if (iceauth_modified) { if (dying) { if (verbose) { @@ -674,6 +684,8 @@ "%s: %s not writable, changes ignored\n", ProgramName, iceauth_filename); } else { + char temp_name[1024]; /* large filename size */ + if (verbose) { printf ("%s authority file %s\n", ignore_locks ? "Ignoring locks and writing" : @@ -686,7 +698,7 @@ ProgramName, temp_name); } else { (void) unlink (iceauth_filename); -#if defined(WIN32) || defined(__UNIXOS2__) +#ifdef WIN32 if (rename(temp_name, iceauth_filename) == -1) #else /* Attempt to rename() if link() fails, since this may be on a FS that does not support hard links */ @@ -835,7 +847,7 @@ AuthList **firstp, AuthList *second, int *nnewp, int *nreplp, int *ndupp) { - AuthList *a, *b, *first, *tail; + AuthList *first, *tail; int n = 0, nnew = 0, nrepl = 0, ndup = 0; if (!second) return 0; @@ -861,12 +873,11 @@ * bump the tail up to include it, otherwise, cut the entry out of * the chain. */ - for (b = second; b; ) { + for (AuthList *b = second; b; ) { AuthList *next = b->next; /* in case we free it */ - int duplicate; + AuthList *a = first; + int duplicate = 0; - duplicate = 0; - a = first; for (;;) { int authDataSame; if (match_auth (a->auth, b->auth, &authDataSame)) { @@ -928,19 +939,19 @@ DoFunc do_func, void *data) { - int i; int status = 0; int errors = 0; - AuthList *l, *next; - const char *protoname, *protodata, *netid, *authname; + AuthList *next; - for (l = iceauth_head; l; l = next) + for (AuthList *l = iceauth_head; l; l = next) { + const char *protoname, *protodata, *netid, *authname; + next = l->next; protoname = protodata = netid = authname = NULL; - for (i = start; i < argc; i++) + for (int i = start; i < argc; i++) { if (!strncmp ("protoname=", argv[i], 10)) protoname = argv[i] + 10; @@ -1018,18 +1029,17 @@ FILE *fp, const char *cmd) { - const CommandTable *ct; int n = 0; fprintf (fp, "\n"); if (!cmd) { /* if no cmd, print all help */ - for (ct = command_table; ct->name; ct++) { + for (const CommandTable *ct = command_table; ct->name; ct++) { fprintf (fp, "%s\n\n", ct->helptext); n++; } } else { size_t len = strlen (cmd); - for (ct = command_table; ct->name; ct++) { + for (const CommandTable *ct = command_table; ct->name; ct++) { if (strncmp (cmd, ct->name, len) == 0) { fprintf (fp, "%s\n\n", ct->helptext); n++; @@ -1080,13 +1090,11 @@ int argc _X_UNUSED, const char **argv _X_UNUSED) { - const CommandTable *ct; - unsigned int i; #define WIDEST_COLUMN 72 unsigned int col = WIDEST_COLUMN; printf ("Commands:\n"); - for (ct = command_table; ct->name; ct++) { + for (const CommandTable *ct = command_table; ct->name; ct++) { if ((col + ct->maxlen) > WIDEST_COLUMN) { if (ct != command_table) { putc ('\n', stdout); @@ -1096,7 +1104,7 @@ } fputs (ct->name, stdout); col += ct->maxlen; - for (i = ct->maxlen; i < COMMAND_NAMES_PADDED_WIDTH; i++) { + for (unsigned int i = ct->maxlen; i < COMMAND_NAMES_PADDED_WIDTH; i++) { putc (' ', stdout); col++; } @@ -1123,10 +1131,8 @@ ld.fp = stdout; if (argc == 1) { - register AuthList *l; - if (iceauth_head) { - for (l = iceauth_head; l; l = l->next) { + for (AuthList *l = iceauth_head; l; l = l->next) { dump_entry (inputfilename, lineno, l->auth, &ld); } } @@ -1148,10 +1154,8 @@ int argc, const char **argv) { - int i; int errors = 0; - AuthList *head, *tail, *listhead, *listtail; - int nentries, nnew, nrepl, ndup; + AuthList *listhead, *listtail; if (argc < 2) { prefix (inputfilename, lineno); @@ -1161,10 +1165,12 @@ listhead = listtail = NULL; - for (i = 1; i < argc; i++) { + for (int i = 1; i < argc; i++) { const char *filename = argv[i]; FILE *fp; Bool used_stdin = False; + int nentries; + AuthList *head, *tail; fp = open_file (&filename, "rb", &used_stdin, inputfilename, lineno, @@ -1192,6 +1198,8 @@ * if we have new entries, merge them in (freeing any duplicates) */ if (listhead) { + int nentries, nnew, nrepl, ndup; + nentries = merge_entries (&iceauth_head, listhead, &nnew, &nrepl, &ndup); if (verbose) @@ -1531,14 +1539,10 @@ const char **argv) { const char *script; - char buf[BUFSIZ]; FILE *fp; Bool used_stdin = False; - size_t len; - int errors = 0, status; + int errors = 0; int sublineno = 0; - char **subargv; - int subargc; Bool prompt = False; /* only true if reading from tty */ if (argc != 2 || !argv[1]) { @@ -1557,6 +1561,11 @@ if (verbose && used_stdin && isatty (fileno (fp))) prompt = True; while (!alldone) { + char buf[BUFSIZ]; + size_t len; + char **subargv; + int subargc; + buf[0] = '\0'; if (prompt) { printf ("iceauth> "); @@ -1575,8 +1584,8 @@ buf[--len] = '\0'; /* remove new line */ subargv = split_into_words (buf, &subargc); if (subargv) { - status = process_command (script, sublineno, subargc, - (const char **) subargv); + int status = process_command (script, sublineno, subargc, + (const char **) subargv); free ((char *) subargv); errors += status; } else {
