Use erorr_msg( isntead of fprintf(stderr,
authorGlenn L McGrath <bug1@ihug.co.nz>
Thu, 28 Nov 2002 09:30:40 +0000 (09:30 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Thu, 28 Nov 2002 09:30:40 +0000 (09:30 -0000)
editors/awk.c

index 968fa028acf29cb7616db04041fd6755d7c38bb8..aea852b0d1498d7f8055deb7bad9b1e6938e96f7 100644 (file)
@@ -461,9 +461,9 @@ static const char EMSG_UNDEF_FUNC[] = "Call to undefined function";
 static const char EMSG_NO_MATH[] = "Math support is not compiled in";
 #endif
 
-static void syntax_error(const char * const message) {
-
-       fprintf(stderr, "awk: %s:%i: %s\n", programname, lineno, message);
+static void syntax_error(const char * const message)
+{
+       error_msg("%s:%i: %s", programname, lineno, message);
        awk_exit(1);
 }
 
@@ -2681,7 +2681,7 @@ extern int awk_main(int argc, char **argv) {
                                free(s);
                                break;
                        case 'W':
-                               fprintf(stderr, "Warning: unrecognized option '-W %s' ignored\n", optarg);
+                               error_msg("Warning: unrecognized option '-W %s' ignored\n", optarg);
                                break;
 
                        default: