Subj : Debugging MakeNL To : Andrew Clarke From : Ulrich Schroeter Date : Fri Jul 27 2018 01:25:02 Hi Andrew, Saturday August 24 2013 01:43, you wrote to All: Hey ... super =:) here is a quick report ... ac> Here's the bug: ac> -+- makenl.c 2012/10/14 15:24:21 1.14 ac> +++ makenl.c 2013/01/30 21:58:10 1.15 ac> @@ -1,4 +1,4 @@ ac> -/* $Id: makenl.c,v 1.14 2012/10/14 15:24:21 ozzmosis Exp $ */ ac> +/* $Id: makenl.c,v 1.15 2013/01/30 21:58:10 ajleary Exp $ */ ac> ac> #include ac> #include ac> @@ -189,7 +189,7 @@ ac> mklog(LOG_INFO, "Cmdline: %s", cmdline_to_str(argv)); ac> mklog(LOG_INFO, "Using '%s' in '%s'", CfgFile, CurDir); ac> ac> - for (OldWeeks = 3; OldWeeks >= 0; OldWeeks--) ac> + for (OldWeeks = 7; OldWeeks >= 0; OldWeeks--) ac> { ac> searchdow(NewExtWDay, -7 * OldWeeks + 6, &SplitTimePtr); ac> sprintf(OldExtensions[OldWeeks], "%03d", ac> ac> The first iteration of the loop is writing to OldExtensions[7], but ac> the array is too small in fileutil.c: ac> ac> char OldExtensions[4][MYMAXEXT]; ac> ac> This is now fixed in CVS. and fileutil.h too ... ac> If everyone could build the latest version from CVS and test it, that ac> would be great. .....snip_on...................................................... MAKENL.C(325): Error! E1058: Cannot use typedef 'FILE' as a variable MAKENL.C(325): Error! E1011: Symbol 'fp' has not been declared MAKENL.C(325): Error! E1014: Left operand must be an 'lvalue' MAKENL.C(329): Warning! W102: Type mismatch (warning) MAKENL.C(329): Note! I2003: source conversion type is 'int ' MAKENL.C(329): Note! I2004: target conversion type is 'struct __iobuf *' MAKENL.C(329): Note! I2002: 'fputs' defined in: E:\WATCOM\H\stdio.h(316) MAKENL.C(330): Warning! W102: Type mismatch (warning) MAKENL.C(330): Note! I2003: source conversion type is 'int ' MAKENL.C(330): Note! I2004: target conversion type is 'struct __iobuf *' MAKENL.C(330): Note! I2002: 'fclose' defined in: E:\WATCOM\H\stdio.h(306) .....snip_off..................................................... affected code section: 324 mklog(LOG_DEBUG, "open BatchFile pointer"); 325 FILE *fp = fopen(BatchFile, "w"); 326 327 if (fp) 328 { 329 fputs(os_deslashify(cmdbuf), fp); 330 fclose(fp); 331 } 332 } base source rev 3.3.6 after fixing the FILE *fp problem add makenl.c line 72 +1 static FILE *fp; replace makenl.c line 324ff. 324 mklog(LOG_DEBUG, "open BatchFile pointer"); 325 fp = fopen(BatchFile, "w"); 326 327 if (fp) 328 { 329 fputs(os_deslashify(cmdbuf), fp); 330 fclose(fp); 331 } 332 } compile works, program exec terminated with error 5 =:& still trying to get the named cvs codebase code .. somewhere ... mhh ... cvs says Age -> 4 years ?!?!? still I'm correct here ? http://makenl.cvs.sourceforge.net/viewvc/makenl/makenl/ regards, uli ;-) --- * Origin: AMBROSIA - Frankfurt/Main - Germany (2:244/1120) .