Changeset 7917 for trunk/Ohana/src/opihi/cmd.basic/sprintf.c
- Timestamp:
- Jul 16, 2006, 10:58:49 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/cmd.basic/sprintf.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.basic/sprintf.c
r2843 r7917 11 11 12 12 if (argc < 3) { 13 fprintf (stderr, "USAGE: sprintf var format value value ...\n");13 gprint (GP_ERR, "USAGE: sprintf var format value value ...\n"); 14 14 return (FALSE); 15 15 } … … 26 26 p2 = strchr (p1, '%'); 27 27 if (p2 == (char *) NULL) { 28 fprintf (stderr, "mismatch between format and values\n");28 gprint (GP_ERR, "mismatch between format and values\n"); 29 29 return (FALSE); 30 30 } 31 31 if (strlen(q) + p2 - p1 > NCHAR) { 32 fprintf (stderr, "line too long");32 gprint (GP_ERR, "line too long"); 33 33 return (FALSE); 34 34 } … … 53 53 break; 54 54 default: 55 fprintf (stderr, "syntax error in format (only e,f,s,d,c,x allowed)\n");55 gprint (GP_ERR, "syntax error in format (only e,f,s,d,c,x allowed)\n"); 56 56 return (FALSE); 57 57 } 58 58 if (strlen(q) + strlen(tmp) > NCHAR) { 59 fprintf (stderr, "line too long");59 gprint (GP_ERR, "line too long"); 60 60 return (FALSE); 61 61 } … … 66 66 p2 = strchr (p1, '%'); 67 67 if (p2 != (char *) NULL) { 68 fprintf (stderr, "mismatch between format and values\n");68 gprint (GP_ERR, "mismatch between format and values\n"); 69 69 return (FALSE); 70 70 } … … 72 72 p2 = p1 + strlen (p1); 73 73 if (strlen(q) + p2 - p1 > NCHAR) { 74 fprintf (stderr, "line too long");74 gprint (GP_ERR, "line too long"); 75 75 return (FALSE); 76 76 }
Note:
See TracChangeset
for help on using the changeset viewer.
