summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordenny <denny@cvs.openbsd.org>1997-08-19 06:35:14 +0000
committerdenny <denny@cvs.openbsd.org>1997-08-19 06:35:14 +0000
commit3c662dfd6d37ed4e8aededed48485ddb7ca178b0 (patch)
tree7dcef05da4d37ddc3a23a25377c82dbd6961b1a3
parentf5cf3fa4f4eea2e99e3a2238d9c8d89450ade8d1 (diff)
POSIX 1003.2: exit code is 3 if memory allocation fails, 2 if expr invalid.
-rw-r--r--bin/expr/expr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/expr/expr.c b/bin/expr/expr.c
index 96313c67818..2d6581c16be 100644
--- a/bin/expr/expr.c
+++ b/bin/expr/expr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: expr.c,v 1.6 1997/07/23 14:44:21 kstailey Exp $ */
+/* $OpenBSD: expr.c,v 1.7 1997/08/19 06:35:13 denny Exp $ */
/* $NetBSD: expr.c,v 1.3.6.1 1996/06/04 20:41:47 cgd Exp $ */
/*
@@ -45,7 +45,7 @@ make_int(i)
vp = (struct val *) malloc(sizeof(*vp));
if (vp == NULL) {
- err(2, NULL);
+ err(3, NULL);
}
vp->type = integer;
vp->u.i = i;
@@ -61,7 +61,7 @@ make_str(s)
vp = (struct val *) malloc(sizeof(*vp));
if (vp == NULL || ((vp->u.s = strdup(s)) == NULL)) {
- err(2, NULL);
+ err(3, NULL);
}
vp->type = string;
return vp;
@@ -155,7 +155,7 @@ to_string(vp)
tmp = malloc(25);
if (tmp == NULL) {
- err(2, NULL);
+ err(3, NULL);
}
snprintf(tmp, 25, "%d", vp->u.i);
vp->type = string;