summaryrefslogtreecommitdiffstats
path: root/bin/expr/expr.c
diff options
context:
space:
mode:
authordenny <denny@openbsd.org>1997-08-19 06:35:13 +0000
committerdenny <denny@openbsd.org>1997-08-19 06:35:13 +0000
commitf286c4b1a472596bc9f45c1fecb6110c3fcf3521 (patch)
treee56fde396d2624cd4157489c0370af0deaa22cea /bin/expr/expr.c
parentNote POSIX 1003.2. (diff)
downloadwireguard-openbsd-f286c4b1a472596bc9f45c1fecb6110c3fcf3521.tar.xz
wireguard-openbsd-f286c4b1a472596bc9f45c1fecb6110c3fcf3521.zip
POSIX 1003.2: exit code is 3 if memory allocation fails, 2 if expr invalid.
Diffstat (limited to 'bin/expr/expr.c')
-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;