import bonsai fixes
This commit is contained in:
parent
1b375e9d9a
commit
428a56eaad
32
dj/dj.c
32
dj/dj.c
@ -210,21 +210,6 @@ Io_write(struct Io *io){
|
|||||||
return io;
|
return io;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parses the string s to an integer, returning either the integer or in the
|
|
||||||
* case of an error a negative integer. This is used for argument parsing
|
|
||||||
* (e.g. -B [int]) in dj and no negative integer would be valid anyway. */
|
|
||||||
static long
|
|
||||||
parse(char *s){
|
|
||||||
long r;
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
r = (long)strtol(s, &s, 0);
|
|
||||||
if(*s == '\0' /* no chars left unparsed */ && errno == 0)
|
|
||||||
return r;
|
|
||||||
else
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Prints an error message suitable for the event of an operating system error,
|
/* Prints an error message suitable for the event of an operating system error,
|
||||||
* with the error itself to be described in the string s. */
|
* with the error itself to be described in the string s. */
|
||||||
static int
|
static int
|
||||||
@ -247,6 +232,21 @@ output(struct Io io[2]){
|
|||||||
return io;
|
return io;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Parses the string s to an integer, returning either the integer or in the
|
||||||
|
* case of an error a negative integer. This is used for argument parsing
|
||||||
|
* (e.g. -B [int]) in dj and no negative integer would be valid anyway. */
|
||||||
|
static long
|
||||||
|
parse(char *s){
|
||||||
|
long r;
|
||||||
|
|
||||||
|
errno = 0;
|
||||||
|
r = (long)strtol(s, &s, 0);
|
||||||
|
if(*s == '\0' /* no chars left unparsed */ && errno == 0)
|
||||||
|
return r;
|
||||||
|
else
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
usage(char *argv0){
|
usage(char *argv0){
|
||||||
|
|
||||||
@ -339,7 +339,7 @@ int main(int argc, char *argv[]){
|
|||||||
else if(io[0].bufuse < io[0].bs){
|
else if(io[0].bufuse < io[0].bs){
|
||||||
++io[0].prec;
|
++io[0].prec;
|
||||||
if(debug >= 2){
|
if(debug >= 2){
|
||||||
fprintf(stderr, "%s: Partial write:\n\t", ARGV0(argv[0]));
|
fprintf(stderr, "%s: Partial read:\n\t", ARGV0(argv[0]));
|
||||||
output(io);
|
output(io);
|
||||||
}
|
}
|
||||||
if(!noerror)
|
if(!noerror)
|
||||||
|
Loading…
Reference in New Issue
Block a user