diff --git a/c/unix/io.c b/c/unix/io.c index ed21219..1548ed9 100644 --- a/c/unix/io.c +++ b/c/unix/io.c @@ -146,26 +146,6 @@ ps_write_char(char ch, FILE *port) return 0; } } -long -ps_write_integer(long n, FILE *port) -{ - int status; - - static long write_integer(unsigned long n, FILE *port); - - if (n == 0) { - WRITE_CHAR('0', port, status); - return status; } - else if (n > 0) - return write_integer(n, port); - else { - WRITE_CHAR('-', port, status); - if (status == 0) - return write_integer(- n, port); - else - return status; } -} - static long write_integer(unsigned long n, FILE *port) { @@ -182,6 +162,24 @@ write_integer(unsigned long n, FILE *port) return status; } +long +ps_write_integer(long n, FILE *port) +{ + int status; + + if (n == 0) { + WRITE_CHAR('0', port, status); + return status; } + else if (n > 0) + return write_integer(n, port); + else { + WRITE_CHAR('-', port, status); + if (status == 0) + return write_integer(- n, port); + else + return status; } +} + long ps_write_string(char *string, FILE *port) {