head 1.3; access; symbols pkgsrc-2026Q1:1.3.0.108 pkgsrc-2026Q1-base:1.3 pkgsrc-2025Q4:1.3.0.106 pkgsrc-2025Q4-base:1.3 pkgsrc-2025Q3:1.3.0.104 pkgsrc-2025Q3-base:1.3 pkgsrc-2025Q2:1.3.0.102 pkgsrc-2025Q2-base:1.3 pkgsrc-2025Q1:1.3.0.100 pkgsrc-2025Q1-base:1.3 pkgsrc-2024Q4:1.3.0.98 pkgsrc-2024Q4-base:1.3 pkgsrc-2024Q3:1.3.0.96 pkgsrc-2024Q3-base:1.3 pkgsrc-2024Q2:1.3.0.94 pkgsrc-2024Q2-base:1.3 pkgsrc-2024Q1:1.3.0.92 pkgsrc-2024Q1-base:1.3 pkgsrc-2023Q4:1.3.0.90 pkgsrc-2023Q4-base:1.3 pkgsrc-2023Q3:1.3.0.88 pkgsrc-2023Q3-base:1.3 pkgsrc-2023Q2:1.3.0.86 pkgsrc-2023Q2-base:1.3 pkgsrc-2023Q1:1.3.0.84 pkgsrc-2023Q1-base:1.3 pkgsrc-2022Q4:1.3.0.82 pkgsrc-2022Q4-base:1.3 pkgsrc-2022Q3:1.3.0.80 pkgsrc-2022Q3-base:1.3 pkgsrc-2022Q2:1.3.0.78 pkgsrc-2022Q2-base:1.3 pkgsrc-2022Q1:1.3.0.76 pkgsrc-2022Q1-base:1.3 pkgsrc-2021Q4:1.3.0.74 pkgsrc-2021Q4-base:1.3 pkgsrc-2021Q3:1.3.0.72 pkgsrc-2021Q3-base:1.3 pkgsrc-2021Q2:1.3.0.70 pkgsrc-2021Q2-base:1.3 pkgsrc-2021Q1:1.3.0.68 pkgsrc-2021Q1-base:1.3 pkgsrc-2020Q4:1.3.0.66 pkgsrc-2020Q4-base:1.3 pkgsrc-2020Q3:1.3.0.64 pkgsrc-2020Q3-base:1.3 pkgsrc-2020Q2:1.3.0.60 pkgsrc-2020Q2-base:1.3 pkgsrc-2020Q1:1.3.0.40 pkgsrc-2020Q1-base:1.3 pkgsrc-2019Q4:1.3.0.62 pkgsrc-2019Q4-base:1.3 pkgsrc-2019Q3:1.3.0.58 pkgsrc-2019Q3-base:1.3 pkgsrc-2019Q2:1.3.0.56 pkgsrc-2019Q2-base:1.3 pkgsrc-2019Q1:1.3.0.54 pkgsrc-2019Q1-base:1.3 pkgsrc-2018Q4:1.3.0.52 pkgsrc-2018Q4-base:1.3 pkgsrc-2018Q3:1.3.0.50 pkgsrc-2018Q3-base:1.3 pkgsrc-2018Q2:1.3.0.48 pkgsrc-2018Q2-base:1.3 pkgsrc-2018Q1:1.3.0.46 pkgsrc-2018Q1-base:1.3 pkgsrc-2017Q4:1.3.0.44 pkgsrc-2017Q4-base:1.3 pkgsrc-2017Q3:1.3.0.42 pkgsrc-2017Q3-base:1.3 pkgsrc-2017Q2:1.3.0.38 pkgsrc-2017Q2-base:1.3 pkgsrc-2017Q1:1.3.0.36 pkgsrc-2017Q1-base:1.3 pkgsrc-2016Q4:1.3.0.34 pkgsrc-2016Q4-base:1.3 pkgsrc-2016Q3:1.3.0.32 pkgsrc-2016Q3-base:1.3 pkgsrc-2016Q2:1.3.0.30 pkgsrc-2016Q2-base:1.3 pkgsrc-2016Q1:1.3.0.28 pkgsrc-2016Q1-base:1.3 pkgsrc-2015Q4:1.3.0.26 pkgsrc-2015Q4-base:1.3 pkgsrc-2015Q3:1.3.0.24 pkgsrc-2015Q3-base:1.3 pkgsrc-2015Q2:1.3.0.22 pkgsrc-2015Q2-base:1.3 pkgsrc-2015Q1:1.3.0.20 pkgsrc-2015Q1-base:1.3 pkgsrc-2014Q4:1.3.0.18 pkgsrc-2014Q4-base:1.3 pkgsrc-2014Q3:1.3.0.16 pkgsrc-2014Q3-base:1.3 pkgsrc-2014Q2:1.3.0.14 pkgsrc-2014Q2-base:1.3 pkgsrc-2014Q1:1.3.0.12 pkgsrc-2014Q1-base:1.3 pkgsrc-2013Q4:1.3.0.10 pkgsrc-2013Q4-base:1.3 pkgsrc-2013Q3:1.3.0.8 pkgsrc-2013Q3-base:1.3 pkgsrc-2013Q2:1.3.0.6 pkgsrc-2013Q2-base:1.3 pkgsrc-2013Q1:1.3.0.4 pkgsrc-2013Q1-base:1.3 pkgsrc-2012Q4:1.3.0.2 pkgsrc-2012Q4-base:1.3 pkgsrc-2012Q3:1.2.0.8 pkgsrc-2012Q3-base:1.2 pkgsrc-2012Q2:1.2.0.6 pkgsrc-2012Q2-base:1.2 pkgsrc-2012Q1:1.2.0.4 pkgsrc-2012Q1-base:1.2 pkgsrc-2011Q4:1.2.0.2 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q3:1.1.1.1.0.76 pkgsrc-2011Q3-base:1.1.1.1 pkgsrc-2011Q2:1.1.1.1.0.74 pkgsrc-2011Q2-base:1.1.1.1 pkgsrc-2011Q1:1.1.1.1.0.72 pkgsrc-2011Q1-base:1.1.1.1 pkgsrc-2010Q4:1.1.1.1.0.70 pkgsrc-2010Q4-base:1.1.1.1 pkgsrc-2010Q3:1.1.1.1.0.68 pkgsrc-2010Q3-base:1.1.1.1 pkgsrc-2010Q2:1.1.1.1.0.66 pkgsrc-2010Q2-base:1.1.1.1 pkgsrc-2010Q1:1.1.1.1.0.64 pkgsrc-2010Q1-base:1.1.1.1 pkgsrc-2009Q4:1.1.1.1.0.62 pkgsrc-2009Q4-base:1.1.1.1 pkgsrc-2009Q3:1.1.1.1.0.60 pkgsrc-2009Q3-base:1.1.1.1 pkgsrc-2009Q2:1.1.1.1.0.58 pkgsrc-2009Q2-base:1.1.1.1 pkgsrc-2009Q1:1.1.1.1.0.56 pkgsrc-2009Q1-base:1.1.1.1 pkgsrc-2008Q4:1.1.1.1.0.54 pkgsrc-2008Q4-base:1.1.1.1 pkgsrc-2008Q3:1.1.1.1.0.52 pkgsrc-2008Q3-base:1.1.1.1 cube-native-xorg:1.1.1.1.0.50 cube-native-xorg-base:1.1.1.1 pkgsrc-2008Q2:1.1.1.1.0.48 pkgsrc-2008Q2-base:1.1.1.1 cwrapper:1.1.1.1.0.46 pkgsrc-2008Q1:1.1.1.1.0.44 pkgsrc-2008Q1-base:1.1.1.1 pkgsrc-2007Q4:1.1.1.1.0.42 pkgsrc-2007Q4-base:1.1.1.1 pkgsrc-2007Q3:1.1.1.1.0.40 pkgsrc-2007Q3-base:1.1.1.1 pkgsrc-2007Q2:1.1.1.1.0.38 pkgsrc-2007Q2-base:1.1.1.1 pkgsrc-2007Q1:1.1.1.1.0.36 pkgsrc-2007Q1-base:1.1.1.1 pkgsrc-2006Q4:1.1.1.1.0.34 pkgsrc-2006Q4-base:1.1.1.1 pkgsrc-2006Q3:1.1.1.1.0.32 pkgsrc-2006Q3-base:1.1.1.1 pkgsrc-2006Q2:1.1.1.1.0.30 pkgsrc-2006Q2-base:1.1.1.1 pkgsrc-2006Q1:1.1.1.1.0.28 pkgsrc-2006Q1-base:1.1.1.1 pkgsrc-2005Q4:1.1.1.1.0.26 pkgsrc-2005Q4-base:1.1.1.1 pkgsrc-2005Q3:1.1.1.1.0.24 pkgsrc-2005Q3-base:1.1.1.1 pkgsrc-2005Q2:1.1.1.1.0.22 pkgsrc-2005Q2-base:1.1.1.1 pkgsrc-2005Q1:1.1.1.1.0.20 pkgsrc-2005Q1-base:1.1.1.1 pkgsrc-2004Q4:1.1.1.1.0.18 pkgsrc-2004Q4-base:1.1.1.1 pkgsrc-2004Q3:1.1.1.1.0.16 pkgsrc-2004Q3-base:1.1.1.1 pkgsrc-2004Q2:1.1.1.1.0.14 pkgsrc-2004Q2-base:1.1.1.1 pkgsrc-2004Q1:1.1.1.1.0.12 pkgsrc-2004Q1-base:1.1.1.1 pkgsrc-2003Q4:1.1.1.1.0.10 pkgsrc-2003Q4-base:1.1.1.1 netbsd-1-6-1:1.1.1.1.0.6 netbsd-1-6-1-base:1.1.1.1 netbsd-1-6:1.1.1.1.0.8 netbsd-1-6-RELEASE-base:1.1.1.1 pkgviews:1.1.1.1.0.4 pkgviews-base:1.1.1.1 buildlink2:1.1.1.1.0.2 buildlink2-base:1.1.1.1 netbsd-1-5-PATCH003:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.3 date 2012.12.23.18.43.47; author dholland; state Exp; branches; next 1.2; 1.2 date 2011.12.06.19.55.43; author joerg; state Exp; branches; next 1.1; 1.1 date 2001.10.02.13.15.56; author wiz; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.10.02.13.15.56; author wiz; state Exp; branches; next ; desc @@ 1.3 log @Use c89. Pass gcc -Wall. Fix clang build. While here, use snprintf instead of sprintf. PKGREVISION -> 2. @ text @$NetBSD: patch-ac,v 1.2 2011/12/06 19:55:43 joerg Exp $ - use standard headers - declare functions before calling them - use c89 function declarations - give functions return types, including sometimes "void" - silence clang and gcc warnings about assignments inside conditionals - silence clang warnings about braces - silence gcc warnings about unused/uninitialized variables - fix insecure-temporary-files - use snprintf() instead of sprintf() - call free() correctly - call qsort() correctly - pass gcc -Wall -Werror (with gcc 4.5) --- mapit.c.orig 1998-03-13 19:38:03.000000000 +0000 +++ mapit.c @@@@ -149,11 +149,18 @@@@ fix parse_status to handle retreat with mutilple alternate destinations */ #ifdef MACINTOSH -#include #include #include +#else +#include #endif +#include +#include +#include +#include + + #ifdef STRDUP_MISSING #ifdef ANSI char *strdup(char *s1); @@@@ -162,7 +169,7 @@@@ char *strdup(); #endif #endif -#ifdef STRRSTR_MISSING +#ifdef STRSTR_MISSING #ifdef ANSI char *strrstr(char *s1,char *s2); #else @@@@ -170,11 +177,13 @@@@ char *strrstr(); #endif #endif -#include -#include -#include - -extern char *strstr(); +#ifdef STRRSTR_MISSING +#ifdef ANSI +char *strrstr(char *s1,char *s2); +#else +char *strrstr(); +#endif +#endif #define MIN(x,y) (x ownerlist[i]) ownerlist[i] = ownerlist[i+1]; else ownerlist[i+1] = ownerlist[i]; + } + } - if(!(nstdout = fopen(tempfilename, "r"))) + if(!(nstdout = fdopen(fd, "r"))) fprintf(stderr,"Unable to reopen file.\n"); else { while(fgets(line, BUFSIZ, nstdout)) @@@@ -532,6 +560,7 @@@@ main(argc,argv) remove(tempfilename); } } + return 0; } @@@@ -555,12 +584,13 @@@@ main(argc,argv) location nick | full_name */ -parse_movement() +static void +parse_movement(void) { char line[BUFSIZ]; /* the current order being processed */ char copy[BUFSIZ]; /* a temp copy */ char *p0,*p1,*p2, *p3; /* some char pointers */ - int i,j,k; /* misc counters */ + int i; /* misc counters */ char country[BUFSIZ]; char country2[BUFSIZ]; @@@@ -587,13 +617,11 @@@@ parse_movement() char *msg; /* current bouce/cut message */ int fail; /* flag to indicate success of order */ - int x,y; /* map coordinate of support/convoy arrow */ int error; /* true if a syntax (or malloc) error */ for (i=0; i 0))) + ((p1=strrstr(p0," C "))!=NULL && (strncmp(p0,"OFF BOARD", 9) > 0))) order = CONVOY; - else if (p1=strstr(p0," PROXY GIVEN TO ")) + else if ((p1=strstr(p0," PROXY GIVEN TO ")) != NULL) order = PROXY; - else if ((p1=strstr(p0," -> ")) || - (p1=strstr(p0," - ")) || - (p1=strstr(p0," M ")) || - (p1=strstr(p0," TO ")) || - (p1=strstr(p0," MOVE"))) /* or MOVES */ + else if ((p1=strstr(p0," -> "))!=NULL || + (p1=strstr(p0," - "))!=NULL || + (p1=strstr(p0," M "))!=NULL || + (p1=strstr(p0," TO "))!=NULL || + (p1=strstr(p0," MOVE"))!=NULL) /* or MOVES */ order = MOVE; - else if ((p1=strstr(p0," HOLD")) || /* or HOLDS */ - (p1=strstr(p0," H."))) + else if ((p1=strstr(p0," HOLD"))!=NULL || /* or HOLDS */ + (p1=strstr(p0," H."))!=NULL) order = HOLD; - else if ((p1=strstr(p0,", NO ORDER PROCESSED")) || - (p1=strstr(p0,", NO MOVE RECEIVED")) || - (p1=strstr(p0," NMR"))) + else if ((p1=strstr(p0,", NO ORDER PROCESSED"))!=NULL || + (p1=strstr(p0,", NO MOVE RECEIVED"))!=NULL || + (p1=strstr(p0," NMR"))!=NULL) order = NMR; if (order == UNKNOWN) { @@@@ -774,33 +802,35 @@@@ parse_movement() fprintf(stderr,"movement: unable to parse destination location in convoy command: %s\n",p1); break; } - sprintf(new," %c %.3s C %.3s - %-6.6s %.9s", + snprintf(new, sizeof(new), " %c %.3s C %.3s - %-6.6s %.9s", unit,map[si].nick,map[di].nick,map[di2].nick,msg); if (fail) - sprintf(newg,"FailedOrder %d %d %d %d %d %d ArrowConvoy OkOrder", + snprintf(newg, sizeof(newg), + "FailedOrder %d %d %d %d %d %d ArrowConvoy OkOrder", map[si].x,map[si].y, map[di].x,map[di].y, map[di2].x,map[di2].y); else - sprintf(newg,"%d %d %d %d %d %d ArrowConvoy", + snprintf(newg, sizeof(newg), + "%d %d %d %d %d %d ArrowConvoy", map[si].x,map[si].y, map[di].x,map[di].y, map[di2].x,map[di2].y); break; case HOLD: - sprintf(new," %c %.3s H %.9s", + snprintf(new, sizeof(new), " %c %.3s H %.9s", unit,map[si].nick,msg); break; - case PROXY: - strcpy(country2, strstr(p1, "TO ") + 3); - sprintf(new," %c %.3s PROXY TO %s %.9s", - unit,map[si].nick,country2,msg); + case PROXY: + strcpy(country2, strstr(p1, "TO ") + 3); + snprintf(new, sizeof(new), " %c %.3s PROXY TO %s %.9s", + unit,map[si].nick,country2,msg); - break; + break; case NMR: - sprintf(new," %c %.3s NMR %.9s", + snprintf(new, sizeof(new), " %c %.3s NMR %.9s", unit,map[si].nick,msg); break; @@@@ -824,8 +854,7 @@@@ parse_movement() p0 = NULL; /* couldn't find unit type */ p1 = p2; /* assume no nationality either */ } else { - if (free(p2) == 0) - ; + free(p2); } } @@@@ -856,14 +885,15 @@@@ parse_movement() fprintf(stderr,"movement: unable to parse target of support command: %s\n",p0); break; } - sprintf(new," %c %.3s S %.3s H %.9s", + snprintf(new, sizeof(new), " %c %.3s S %.3s H %.9s", unit,map[si].nick,map[di].nick,msg); if (fail) - sprintf(newg,"FailedOrder %d %d %d %d ArrowHold OkOrder", + snprintf(newg, sizeof(newg), + "FailedOrder %d %d %d %d ArrowHold OkOrder", map[si].x,map[si].y, map[di].x,map[di].y); else - sprintf(newg,"%d %d %d %d ArrowHold", + snprintf(newg, sizeof(newg), "%d %d %d %d ArrowHold", map[si].x,map[si].y, map[di].x,map[di].y); } else { /* support a unit moving */ @@@@ -878,15 +908,16 @@@@ parse_movement() fprintf(stderr,"movement: unable to parse second target of support command: %s\n",p1); break; } - sprintf(new," %c %.3s S %.3s - %-6.6s %.9s", + snprintf(new, sizeof(new), " %c %.3s S %.3s - %-6.6s %.9s", unit,map[si].nick,map[di].nick,map[di2].nick,msg); if (fail) - sprintf(newg,"FailedOrder %d %d %d %d %d %d ArrowSupport OkOrder", + snprintf(newg, sizeof(newg), + "FailedOrder %d %d %d %d %d %d ArrowSupport OkOrder", map[si].x,map[si].y, map[di].x,map[di].y, map[di2].x,map[di2].y); else - sprintf(newg,"%d %d %d %d %d %d ArrowSupport", + snprintf(newg, sizeof(newg), "%d %d %d %d %d %d ArrowSupport", map[si].x,map[si].y, map[di].x,map[di].y, map[di2].x,map[di2].y); @@@@ -899,16 +930,17 @@@@ parse_movement() fprintf(stderr,"movement: unable to parse destination of move command: %s\n",p1); break; } - sprintf(new," %c %.3s - %-6.6s %.9s", + snprintf(new, sizeof(new), " %c %.3s - %-6.6s %.9s", unit,map[si].nick,map[di].nick,msg); if (fail) - sprintf(newg,"FailedOrder %d %d %d %d ArrowMove OkOrder", + snprintf(newg, sizeof(newg), + "FailedOrder %d %d %d %d ArrowMove OkOrder", map[si].x,map[si].y, map[di].x,map[di].y); else { units[unitcount].loc = di; - sprintf(newg,"%d %d %d %d ArrowMove", + snprintf(newg, sizeof(newg), "%d %d %d %d ArrowMove", map[si].x,map[si].y, map[di].x,map[di].y); } @@@@ -948,16 +980,14 @@@@ parse_movement() fprintf(nstdout,"OrderReport\n"); for (i = 0; i0) { for (i = 0; i instead. */ -parse_fall_report() +static void +parse_fall_report(void) { char line[BUFSIZ],copy[BUFSIZ],temp[BUFSIZ]; char report[BUFSIZ]; @@@@ -1331,7 +1363,7 @@@@ parse_fall_report() char country[BUFSIZ],save[BUFSIZ]; int centers,units; int ci; /* index of center in map database */ - int i,j,k; + int i; /* first we have ownership report */ @@@@ -1346,7 +1378,7 @@@@ parse_fall_report() fprintf(stderr,"ownership: expecting continuation line\n\t%s\n",line); break; } - sprintf(temp,"%s %s",save,line); + snprintf(temp, sizeof(temp), "%s %s",save,line); copyline(copy,temp); } else copyline(copy,line); @@@@ -1363,7 +1395,7 @@@@ parse_fall_report() strcpy(country,p0); if (report[0]!='\0') fprintf(nstdout,"(%s) WriteOwner\n",report); - sprintf(report,"%-10s ",country); + snprintf(report, sizeof(report), "%-10s ", country); } if (p1==NULL || *p1=='\0') continue; /* just a country token, get next line */ @@@@ -1439,17 +1471,16 @@@@ If it is a Status Report, it might inclu [country:] unit location [can retreat to location [or location]] */ -parse_start(report) - int report; +static void +parse_start(int report) { char line[BUFSIZ]; /* the current order being processed */ char copy[BUFSIZ]; /* a temp copy */ char *p0,*p1,*p2; /* some char pointers */ - int i,j,k; /* misc counters */ + int i; /* misc counters */ char country[BUFSIZ]; char unit; /* unit type, "A" or "F" */ - int order; /* one of the following: */ int si; /* index of source location) */ #define MAXORDERS MAXUNITS @@@@ -1457,12 +1488,10 @@@@ parse_start(report) char new[BUFSIZ]; /* current order being formed */ int ordernum; /* count of orders */ - int x,y; /* map coordinate of support/convoy arrow */ int error; /* true if a syntax (or malloc) error */ for (i=0; i ???)",unit,map[si].nick); + snprintf(new, sizeof(new), + " %c %s (-> %s)", unit, map[si].nick, "??" "?"); else - sprintf(new," %c %s (-> %s)",unit,map[si].nick,p2); + snprintf(new, sizeof(new), " %c %s (-> %s)", unit, map[si].nick, p2); else { - sprintf(new," %c %s",unit,map[si].nick); + snprintf(new, sizeof(new), " %c %s",unit,map[si].nick); /* remember that we have a unit at this location */ units[unitcount].country = (char *) strdup(country); @@@@ -1600,15 +1630,14 @@@@ parse_start(report) fprintf(nstdout,"OrderReport\n"); for (i = 0; icountry,u2->country); } -drawmap(title,message) - char *title,*message; +static void +drawmap(char *title, char *message) { int i; @@@@ -1666,9 +1698,10 @@@@ drawmap(title,message) } /* given the new unit positions, draw a new map */ -drawnew() +static void +drawnew(void) { - int i,j,k; + int i; char country[BUFSIZ]; if (unitcount==0) @@@@ -1703,15 +1736,14 @@@@ drawnew() if (units[i].loc>0) fprintf(nstdout,"( %c %s) WriteOrder\n", units[i].type,map[units[i].loc].nick); - if (free(units[i].country) == 0) - ; + free(units[i].country); } unitcount= 0; } /* copy s2 to s1, uppercase, squeeze whitespace */ -copyline(s1,s2) - char *s1,*s2; +static void +copyline(char *s1, const char *s2) { int white; /* white space seen */ @@@@ -1724,8 +1756,8 @@@@ copyline(s1,s2) } } else { white = 0; - if (islower(*s2)) - *(s1++) = toupper(*s2); + if (islower((unsigned char)*s2)) + *(s1++) = toupper((unsigned char)*s2); else *(s1++) = *s2; } @@@@ -1736,8 +1768,8 @@@@ copyline(s1,s2) } -string_check(s,fatal) - char *s; int fatal; +static int +string_check(const char *s, int fatal) { if (s==NULL) { fprintf(stderr,"?: unexpected error, null string pointer\n"); @@@@ -1753,13 +1785,14 @@@@ string_check(s,fatal) } /* init reads the 2 files described above... */ -init() +static int +init(void) { char *fn; FILE *f; char line[BUFSIZ],copy[BUFSIZ],nick[BUFSIZ],owner[BUFSIZ], name[BUFSIZ],nicks[BUFSIZ]; int x,y; - int i,j,k; + int i,j; unitcount = 0; nationcount = 0; @@@@ -1771,7 +1804,7 @@@@ init() fn = (char *)getenv("MAPPS"); if (fn == NULL) fn = DEFAULT_PS; - if (f = fopen(fn,"r")) { + if ((f = fopen(fn,"r")) != NULL) { while (fgets(line,BUFSIZ,f)) fprintf(nstdout,"%s",line); fclose(f); @@@@ -1795,7 +1828,7 @@@@ init() fn = (char *)getenv("MAPINFO"); if (fn == NULL) fn = DEFAULT_INFO; - if (f = fopen(fn,"r")) { + if ((f = fopen(fn,"r")) != NULL) { j = 0; while (fgets(line,BUFSIZ,f)) { /* first section is just a list of nations */ if (line[0]=='#' || line[0]==' ') @@@@ -1848,13 +1881,13 @@@@ init() return 0; } -mapi(name) /* return index of map table entry */ - char *name; +static int +mapi(char *name) /* return index of map table entry */ { - int i,j,k; + int i; char t[BUFSIZ]; - sprintf(t,"|%s|",name); + snprintf(t, sizeof(t), "|%s|", name); for ( i=1; i +#ifdef MACINTOSH d26 15 d42 63 a104 2 @@@@ -229,6 +229,7 @@@@ main(argc,argv) char *p0,*p1; /* and character pointers */ d107 1 a107 1 + int fd; /* file descriptor for output file */ d111 1 a111 1 @@@@ -318,8 +319,8 @@@@ main(argc,argv) d122 28 a149 1 @@@@ -511,7 +512,7 @@@@ main(argc,argv) d152 2 d160 30 a189 1 @@@@ -592,8 +593,7 @@@@ parse_movement() d199 92 a290 1 @@@@ -824,8 +824,7 @@@@ parse_movement() d300 61 a360 1 @@@@ -948,16 +947,14 @@@@ parse_movement() d379 124 a502 1 @@@@ -1461,8 +1458,7 @@@@ parse_start(report) d512 26 a537 1 @@@@ -1600,8 +1596,7 @@@@ parse_start(report) d547 45 a591 1 @@@@ -1703,8 +1698,7 @@@@ drawnew() d601 144 @ 1.1 log @Initial revision @ text @d1 1 a1 1 $NetBSD$ d3 1 a3 1 --- mapit.c.orig Fri Mar 13 20:38:03 1998 d5 11 a15 1 @@@@ -229,6 +229,7 @@@@ d23 1 a23 1 @@@@ -318,8 +319,8 @@@@ d34 1 a34 1 @@@@ -511,7 +512,7 @@@@ d43 69 @ 1.1.1.1 log @Initial import of dipmap-1.16, a tool to draw postscript diplomacy maps from judge output. Based on a package by Nate Johnston on netbsd-users, heavily modified by me. @ text @@