Thread: [brlcad-commits] SF.net SVN: brlcad:[37563] brlcad/trunk/src/util/loop.c
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <br...@us...> - 2010-02-04 21:17:02
|
Revision: 37563 http://brlcad.svn.sourceforge.net/brlcad/?rev=37563&view=rev Author: brlcad Date: 2010-02-04 21:16:55 +0000 (Thu, 04 Feb 2010) Log Message: ----------- basic cleanup, ws. Modified Paths: -------------- brlcad/trunk/src/util/loop.c Modified: brlcad/trunk/src/util/loop.c =================================================================== --- brlcad/trunk/src/util/loop.c 2010-02-04 20:32:53 UTC (rev 37562) +++ brlcad/trunk/src/util/loop.c 2010-02-04 21:16:55 UTC (rev 37563) @@ -19,17 +19,16 @@ */ /** @file loop.c * - * Simple program to output integers or floats or chars between - * "start" and "finish", inclusive. Default is an increment - * of +1 if start < finish or -1 if start > finish. User may - * specify an alternate increment. Also, user may left-pad - * output integers with zeros. There is no attempt to prevent - * "infinite" loops. + * Simple program to output integers or floats or chars between + * "start" and "finish", inclusive. Default is an increment of +1 if + * start < finish or -1 if start > finish. User may specify an + * alternate increment. Also, user may left-pad output integers with + * zeros. There is no attempt to prevent "infinite" loops. * - * Authors - - * John Grosh - * Phil Dykstra - * Michael John Muuss + * Authors - + * John Grosh + * Phil Dykstra + * Michael John Muuss * */ @@ -43,24 +42,25 @@ #include "bu.h" -#define INTEGER 0 -#define REAL 1 -#define CHAR 2 +#define INTEGER 0 +#define REAL 1 +#define CHAR 2 + int -main(int argc, char **argv) +main(int argc, char *argv[]) { - int status = INTEGER; + int status = INTEGER; - int i; - int start, finish, incr; + int i; + int start, finish, incr; - double d; - double dstart, dfinish, dincr; + double d; + double dstart, dfinish, dincr; - char c; - char cstart, cfinish; - int cincr; + char c; + char cstart, cfinish; + int cincr; if (argc < 3 || argc > 5) { bu_exit(9, "Usage: loop [-c|-n] start finish [incr] \n -n is the default option\n"); @@ -68,7 +68,7 @@ /* Check if -c is present in comandline argument*/ - if(argv[1][0] == '-' && argv[1][1]) status = CHAR; + if (argv[1][0] == '-' && argv[1][1]) status = CHAR; /* determine if any arguments are real */ for (i = 1; i < argc; i++) { @@ -99,15 +99,15 @@ printf("%g\n", d); } else if (status == INTEGER) { /* print out integer output */ - char *cp; - char fmt_string[50]; + char *cp; + char fmt_string[50]; - int field_width = 0; + int field_width = 0; - int zeros = 0; /* leading zeros for output */ - int zeros_arg1 = 0; /* leading zeros in arg[1] */ - int zeros_arg2 = 0; /* leading zeros in arg[2] */ - int zeros_arg3 = 0; /* leading zeros in arg[3] */ + int zeros = 0; /* leading zeros for output */ + int zeros_arg1 = 0; /* leading zeros in arg[1] */ + int zeros_arg2 = 0; /* leading zeros in arg[2] */ + int zeros_arg3 = 0; /* leading zeros in arg[3] */ /* count leading leading zeros in argv[1] */ for (cp = argv[1]; *cp == '0'; cp++) @@ -122,7 +122,7 @@ zeros_arg2--; /* if argv[3] exists, count leading leading zeros */ - if (argc == 4 ) { + if (argc == 4) { for (cp = argv[3]; *cp == '0'; cp++) zeros_arg3++; if (*cp == '\0') @@ -180,15 +180,16 @@ } if (cincr >= 0) for (c=cstart; c <= cfinish; c += cincr) - printf("%c\n",c); + printf("%c\n", c); else for (c=cstart; c >= cfinish; c +=cincr) - printf("%c\n",c); + printf("%c\n", c); } return 0; } + /* * Local Variables: * mode: C This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ind...@us...> - 2012-02-09 13:59:36
|
Revision: 49370 http://brlcad.svn.sourceforge.net/brlcad/?rev=49370&view=rev Author: indianlarry Date: 2012-02-09 13:59:29 +0000 (Thu, 09 Feb 2012) Log Message: ----------- Removed "-n" option wasn't being used, cleaned up 'incr' checks, changed types and boundary checks on input scalars trying to get rid of tainted scalar warnings from coverity but not sure it's sufficient. Relates to Run 10 CID 1506. Modified Paths: -------------- brlcad/trunk/src/util/loop.c Modified: brlcad/trunk/src/util/loop.c =================================================================== --- brlcad/trunk/src/util/loop.c 2012-02-09 13:33:32 UTC (rev 49369) +++ brlcad/trunk/src/util/loop.c 2012-02-09 13:59:29 UTC (rev 49370) @@ -37,6 +37,7 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> +#include <ctype.h> #include <math.h> #include "bu.h" @@ -53,28 +54,35 @@ { int status = INTEGER; - int i; - int start, finish, incr; + long int i; + long int start, finish; + long int incr; double d; double dstart, dfinish, dincr; - char c; - char cstart, cfinish; - int cincr; + unsigned long int c; + unsigned long int cstart, cfinish; + long int cincr; if (argc < 3 || argc > 5) { - bu_exit(9, "Usage: loop [-c|-n] start finish [incr] \n -n is the default option\n"); + bu_exit(9, "Usage: loop [-c] start finish [incr] \n -c use for character(char) looping \n"); } /* Check if -c is present in comandline argument*/ - if (argv[1][0] == '-' && argv[1][1]) status = CHAR; + if (argv[1][0] == '-') { + if (argv[1][1] == 'c') { + status = CHAR; + } else if ((argv[1][1] != '.') && !isdigit(argv[1][1])) { + bu_exit(9, "Usage: loop [-c] start finish [incr] \n -c use for character(char) looping \n"); + } + } /* determine if any arguments are real */ for (i = 1; i < argc; i++) { double dval = atof(argv[i]); - int ival = atoi(argv[i]); + long int ival = strtol(argv[i],NULL,0); if (!ZERO(dval - (double)ival)) { status = REAL; break; @@ -83,23 +91,36 @@ if (status == REAL) { dstart = atof(argv[1]); + if ((dstart < -DBL_MAX) || (dstart > DBL_MAX)) { + bu_exit(-1, "'start' out of range of double.\n"); + } + dfinish = atof(argv[2]); + if ((dfinish < -DBL_MAX) || (dfinish > DBL_MAX)) { + bu_exit(-1, "'finish' out of range of double.\n"); + } - if (argc == 4) + if (argc == 4) { dincr = atof(argv[3]); - else { + if ((dincr < -DBL_MAX) || (dincr > DBL_MAX)) { + bu_exit(-1, "'incr' out of range of double.\n"); + } + } else { if (dstart > dfinish) dincr = -1.0; else dincr = 1.0; } - if (dincr >= 0.0) + if (dincr > 0.0) for (d = dstart; d <= dfinish; d += dincr) printf("%g\n", d); - else + else if (dincr < 0.0) for (d = dstart; d >= dfinish; d += dincr) printf("%g\n", d); + else + bu_exit(-1, "loop 'incr' can not be zero.\n"); + } else if (status == INTEGER) { /* print out integer output */ char *cp; @@ -151,42 +172,63 @@ bu_strlcpy(fmt_string, "%d\n", sizeof(fmt_string)); fmt_string[50-1] = '\0'; /* sanity */ - start = atoi(argv[1]); - finish = atoi(argv[2]); + start = strtol(argv[1],NULL,0); + if ((start < INT_MIN) || (start > INT_MAX)) { + bu_exit(-1, "'start' out of range of signed integer.\n"); + } - if (argc == 4) - incr = atoi(argv[3]); - else { + finish = strtol(argv[2],NULL,0); + if ((finish < INT_MIN) || (finish > INT_MAX)) { + bu_exit(-1, "'finish' out of range of signed integer.\n"); + } + + if (argc == 4) { + incr = strtol(argv[3],NULL,0); + if ((incr < INT_MIN) || (incr > INT_MAX)) { + bu_exit(-1, "'incr' out of range of signed integer.\n"); + } + } else { if (start > finish) incr = -1; else incr = 1; } - if (incr >= 0) + if (incr > 0) for (i = start; i <= finish; i += incr) printf(fmt_string, i); - else + else if (incr < 0) for (i = start; i >= finish; i += incr) printf(fmt_string, i); + else + bu_exit(-1, "loop 'incr' can not be zero.\n"); } else { + if (argc < 4) { + bu_exit(9, "Usage: loop [-c] start finish [incr] \n -c use for character(char) looping \n"); + } /* print out character output */ cstart = argv[2][0]; cfinish = argv[3][0]; - if (argc == 5) cincr = atoi(argv[4]); - else { + if (argc == 5) { + cincr = strtol(argv[4],NULL,0); + if ((cincr < -UCHAR_MAX) || (cincr > UCHAR_MAX)) { + bu_exit(-1, "'incr' out of range of char.\n"); + } + } else { if (cstart > cfinish) cincr = -1; else cincr = 1; } - if (cincr >= 0) - for (c=cstart; c <= cfinish; c += cincr) - printf("%c\n", c); + if (cincr > 0) + for (c=cstart; c <= cfinish; c += cincr) + printf("%c\n", (char)c); + else if (cincr < 0) + for (c=cstart; c >= cfinish; c +=cincr) + printf("%c\n", (char)c); else - for (c=cstart; c >= cfinish; c +=cincr) - printf("%c\n", c); + bu_exit(-1, "loop 'incr' can not be zero.\n"); } return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2012-04-18 06:36:43
|
Revision: 50161 http://brlcad.svn.sourceforge.net/brlcad/?rev=50161&view=rev Author: brlcad Date: 2012-04-18 06:36:32 +0000 (Wed, 18 Apr 2012) Log Message: ----------- convert bu_exit() calls to bu_log+return calls for those functions. Modified Paths: -------------- brlcad/trunk/src/util/loop.c Modified: brlcad/trunk/src/util/loop.c =================================================================== --- brlcad/trunk/src/util/loop.c 2012-04-18 06:30:15 UTC (rev 50160) +++ brlcad/trunk/src/util/loop.c 2012-04-18 06:36:32 UTC (rev 50161) @@ -66,7 +66,8 @@ long int cincr; if (argc < 3 || argc > 5) { - bu_exit(9, "Usage: loop [-c] start finish [incr] \n -c use for character(char) looping \n"); + bu_log("Usage: loop [-c] start finish [incr] \n -c use for character(char) looping \n"); + return 9; } /* Check if -c is present in comandline argument*/ @@ -75,7 +76,8 @@ if (argv[1][1] == 'c') { status = CHAR; } else if ((argv[1][1] != '.') && !isdigit(argv[1][1])) { - bu_exit(9, "Usage: loop [-c] start finish [incr] \n -c use for character(char) looping \n"); + bu_log("Usage: loop [-c] start finish [incr] \n -c use for character(char) looping \n"); + return 9; } } @@ -92,18 +94,21 @@ if (status == REAL) { dstart = atof(argv[1]); if ((dstart < -DBL_MAX) || (dstart > DBL_MAX)) { - bu_exit(-1, "'start' out of range of double.\n"); + bu_log("'start' out of range of double.\n"); + return 1; } dfinish = atof(argv[2]); if ((dfinish < -DBL_MAX) || (dfinish > DBL_MAX)) { - bu_exit(-1, "'finish' out of range of double.\n"); + bu_log("'finish' out of range of double.\n"); + reutrn 1; } if (argc == 4) { dincr = atof(argv[3]); if ((dincr < -DBL_MAX) || (dincr > DBL_MAX)) { - bu_exit(-1, "'incr' out of range of double.\n"); + bu_log("'incr' out of range of double.\n"); + return 1; } } else { if (dstart > dfinish) @@ -118,8 +123,10 @@ else if (dincr < 0.0) for (d = dstart; d >= dfinish; d += dincr) printf("%g\n", d); - else - bu_exit(-1, "loop 'incr' can not be zero.\n"); + else { + bu_log("loop 'incr' can not be zero.\n"); + return 1; + } } else if (status == INTEGER) { /* print out integer output */ @@ -174,18 +181,21 @@ start = strtol(argv[1],NULL,0); if ((start < INT_MIN) || (start > INT_MAX)) { - bu_exit(-1, "'start' out of range of signed integer.\n"); + bu_log("'start' out of range of signed integer.\n"); + return 1; } finish = strtol(argv[2],NULL,0); if ((finish < INT_MIN) || (finish > INT_MAX)) { - bu_exit(-1, "'finish' out of range of signed integer.\n"); + bu_log("'finish' out of range of signed integer.\n"); + return 1; } if (argc == 4) { incr = strtol(argv[3],NULL,0); if ((incr < INT_MIN) || (incr > INT_MAX)) { - bu_exit(-1, "'incr' out of range of signed integer.\n"); + bu_log("'incr' out of range of signed integer.\n"); + return 1; } } else { if (start > finish) @@ -200,20 +210,24 @@ else if (incr < 0) for (i = start; i >= finish; i += incr) printf(fmt_string, i); - else - bu_exit(-1, "loop 'incr' can not be zero.\n"); + else { + bu_log("loop 'incr' can not be zero.\n"); + return 9; + } } else { if (argc < 4) { - bu_exit(9, "Usage: loop [-c] start finish [incr] \n -c use for character(char) looping \n"); + bu_log("Usage: loop [-c] start finish [incr] \n -c use for character(char) looping \n"); + return 9; } /* print out character output */ cstart = argv[2][0]; cfinish = argv[3][0]; - + if (argc == 5) { cincr = strtol(argv[4],NULL,0); if ((cincr < -UCHAR_MAX) || (cincr > UCHAR_MAX)) { - bu_exit(-1, "'incr' out of range of char.\n"); + bu_log("'incr' out of range of char.\n"); + return 1; } } else { if (cstart > cfinish) @@ -227,8 +241,10 @@ else if (cincr < 0) for (c=cstart; c >= cfinish; c +=cincr) printf("%c\n", (char)c); - else - bu_exit(-1, "loop 'incr' can not be zero.\n"); + else { + bu_log("loop 'incr' can not be zero.\n"); + reuturn 1; + } } return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tbr...@us...> - 2012-04-18 11:11:07
|
Revision: 50165 http://brlcad.svn.sourceforge.net/brlcad/?rev=50165&view=rev Author: tbrowder2 Date: 2012-04-18 11:10:55 +0000 (Wed, 18 Apr 2012) Log Message: ----------- correct keyword typo Modified Paths: -------------- brlcad/trunk/src/util/loop.c Modified: brlcad/trunk/src/util/loop.c =================================================================== --- brlcad/trunk/src/util/loop.c 2012-04-18 11:06:31 UTC (rev 50164) +++ brlcad/trunk/src/util/loop.c 2012-04-18 11:10:55 UTC (rev 50165) @@ -101,7 +101,7 @@ dfinish = atof(argv[2]); if ((dfinish < -DBL_MAX) || (dfinish > DBL_MAX)) { bu_log("'finish' out of range of double.\n"); - reutrn 1; + return 1; } if (argc == 4) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ind...@us...> - 2012-04-18 11:14:41
|
Revision: 50163 http://brlcad.svn.sourceforge.net/brlcad/?rev=50163&view=rev Author: indianlarry Date: 2012-04-18 10:49:40 +0000 (Wed, 18 Apr 2012) Log Message: ----------- typo Modified Paths: -------------- brlcad/trunk/src/util/loop.c Modified: brlcad/trunk/src/util/loop.c =================================================================== --- brlcad/trunk/src/util/loop.c 2012-04-18 06:43:16 UTC (rev 50162) +++ brlcad/trunk/src/util/loop.c 2012-04-18 10:49:40 UTC (rev 50163) @@ -243,7 +243,7 @@ printf("%c\n", (char)c); else { bu_log("loop 'incr' can not be zero.\n"); - reuturn 1; + return 1; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2012-04-24 14:18:14
|
Revision: 50259 http://brlcad.svn.sourceforge.net/brlcad/?rev=50259&view=rev Author: brlcad Date: 2012-04-24 14:18:03 +0000 (Tue, 24 Apr 2012) Log Message: ----------- reserve the last possible value so we can bounds check cid 1506 Modified Paths: -------------- brlcad/trunk/src/util/loop.c Modified: brlcad/trunk/src/util/loop.c =================================================================== --- brlcad/trunk/src/util/loop.c 2012-04-24 14:13:11 UTC (rev 50258) +++ brlcad/trunk/src/util/loop.c 2012-04-24 14:18:03 UTC (rev 50259) @@ -223,6 +223,12 @@ cstart = argv[2][0]; cfinish = argv[3][0]; + /* reserve the max value so we can bounds check */ + if (cstart > ULONG_MAX-1) + cstart = ULONG_MAX-1; + if (cfinish > ULONG_MAX-1) + cfinish = ULONG_MAX-1; + if (argc == 5) { cincr = strtol(argv[4],NULL,0); if ((cincr < -UCHAR_MAX) || (cincr > UCHAR_MAX)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2012-04-24 14:23:33
|
Revision: 50260 http://brlcad.svn.sourceforge.net/brlcad/?rev=50260&view=rev Author: brlcad Date: 2012-04-24 14:23:24 +0000 (Tue, 24 Apr 2012) Log Message: ----------- range check argv[1][1] for cid 1506 too Modified Paths: -------------- brlcad/trunk/src/util/loop.c Modified: brlcad/trunk/src/util/loop.c =================================================================== --- brlcad/trunk/src/util/loop.c 2012-04-24 14:18:03 UTC (rev 50259) +++ brlcad/trunk/src/util/loop.c 2012-04-24 14:23:24 UTC (rev 50260) @@ -65,6 +65,8 @@ unsigned long int cstart, cfinish; long int cincr; + int oneone; + if (argc < 3 || argc > 5) { bu_log("Usage: loop [-c] start finish [incr] \n -c use for character(char) looping \n"); return 9; @@ -73,9 +75,15 @@ /* Check if -c is present in comandline argument*/ if (argv[1][0] == '-') { - if (argv[1][1] == 'c') { + oneone = argv[1][1]; + if (oneone < 0) + oneone = 0; + if (oneone > CHAR_MAX) + oneone = CHAR_MAX; + + if (oneone == 'c') { status = CHAR; - } else if ((argv[1][1] != '.') && !isdigit(argv[1][1])) { + } else if ((oneone != '.') && !isdigit(oneone)) { bu_log("Usage: loop [-c] start finish [incr] \n -c use for character(char) looping \n"); return 9; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-11-01 14:36:28
|
Revision: 53414 http://brlcad.svn.sourceforge.net/brlcad/?rev=53414&view=rev Author: carlmoore Date: 2012-11-01 14:36:16 +0000 (Thu, 01 Nov 2012) Log Message: ----------- fix spelling Modified Paths: -------------- brlcad/trunk/src/util/loop.c Modified: brlcad/trunk/src/util/loop.c =================================================================== --- brlcad/trunk/src/util/loop.c 2012-11-01 14:01:54 UTC (rev 53413) +++ brlcad/trunk/src/util/loop.c 2012-11-01 14:36:16 UTC (rev 53414) @@ -72,7 +72,7 @@ return 9; } - /* Check if -c is present in comandline argument*/ + /* Check if -c is present in commandline argument*/ if (argv[1][0] == '-') { oneone = argv[1][1]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tbr...@us...> - 2013-10-26 17:06:36
|
Revision: 58314 http://sourceforge.net/p/brlcad/code/58314 Author: tbrowder2 Date: 2013-10-26 17:06:31 +0000 (Sat, 26 Oct 2013) Log Message: ----------- style Modified Paths: -------------- brlcad/trunk/src/util/loop.c Modified: brlcad/trunk/src/util/loop.c =================================================================== --- brlcad/trunk/src/util/loop.c 2013-10-26 15:57:26 UTC (rev 58313) +++ brlcad/trunk/src/util/loop.c 2013-10-26 17:06:31 UTC (rev 58314) @@ -250,10 +250,10 @@ cincr = 1; } if (cincr > 0) - for (c=cstart; c <= cfinish; c += cincr) + for (c = cstart; c <= cfinish; c += cincr) printf("%c\n", (char)c); else if (cincr < 0) - for (c=cstart; c >= cfinish; c +=cincr) + for (c = cstart; c >= cfinish; c += cincr) printf("%c\n", (char)c); else { bu_log("loop 'incr' can not be zero.\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2014-01-28 23:24:33
|
Revision: 59554 http://sourceforge.net/p/brlcad/code/59554 Author: carlmoore Date: 2014-01-28 23:24:27 +0000 (Tue, 28 Jan 2014) Log Message: ----------- consolidate usage into a routine so it only has to appear in the program once; touch up the Usage; create an 'else' Modified Paths: -------------- brlcad/trunk/src/util/loop.c Modified: brlcad/trunk/src/util/loop.c =================================================================== --- brlcad/trunk/src/util/loop.c 2014-01-28 23:06:25 UTC (rev 59553) +++ brlcad/trunk/src/util/loop.c 2014-01-28 23:24:27 UTC (rev 59554) @@ -48,6 +48,11 @@ #define REAL 1 #define CHAR 2 +void +usage() +{ + bu_log("Usage: loop [-c] start finish [incr]\n -c used for character (char) looping\n"); +} int main(int argc, char *argv[]) @@ -68,7 +73,7 @@ int oneone; if (argc < 3 || argc > 5) { - bu_log("Usage: loop [-c] start finish [incr] \n -c use for character(char) looping \n"); + usage(); return 9; } @@ -78,13 +83,13 @@ oneone = argv[1][1]; if (oneone < 0) oneone = 0; - if (oneone > CHAR_MAX) + else if (oneone > CHAR_MAX) oneone = CHAR_MAX; if (oneone == 'c') { status = CHAR; } else if ((oneone != '.') && !isdigit(oneone)) { - bu_log("Usage: loop [-c] start finish [incr] \n -c use for character(char) looping \n"); + usage(); return 9; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2014-01-28 23:38:40
|
Revision: 59555 http://sourceforge.net/p/brlcad/code/59555 Author: carlmoore Date: 2014-01-28 23:38:36 +0000 (Tue, 28 Jan 2014) Log Message: ----------- oops, another occurrence of Usage Modified Paths: -------------- brlcad/trunk/src/util/loop.c Modified: brlcad/trunk/src/util/loop.c =================================================================== --- brlcad/trunk/src/util/loop.c 2014-01-28 23:24:27 UTC (rev 59554) +++ brlcad/trunk/src/util/loop.c 2014-01-28 23:38:36 UTC (rev 59555) @@ -229,7 +229,7 @@ } } else { if (argc < 4) { - bu_log("Usage: loop [-c] start finish [incr] \n -c use for character(char) looping \n"); + usage(); return 9; } /* print out character output */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2014-01-28 23:44:14
|
Revision: 59556 http://sourceforge.net/p/brlcad/code/59556 Author: carlmoore Date: 2014-01-28 23:44:10 +0000 (Tue, 28 Jan 2014) Log Message: ----------- removed a blank from 2nd line of Usage; field_width does not need to be initialized, because the logic MUST assign it a value Modified Paths: -------------- brlcad/trunk/src/util/loop.c Modified: brlcad/trunk/src/util/loop.c =================================================================== --- brlcad/trunk/src/util/loop.c 2014-01-28 23:38:36 UTC (rev 59555) +++ brlcad/trunk/src/util/loop.c 2014-01-28 23:44:10 UTC (rev 59556) @@ -51,7 +51,7 @@ void usage() { - bu_log("Usage: loop [-c] start finish [incr]\n -c used for character (char) looping\n"); + bu_log("Usage: loop [-c] start finish [incr]\n -c used for character (char) looping\n"); } int @@ -146,7 +146,7 @@ char *cp; char fmt_string[50]; - int field_width = 0; + int field_width; int zeros = 0; /* leading zeros for output */ int zeros_arg1 = 0; /* leading zeros in arg[1] */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |