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