diff options
author | 2017-12-06 13:48:05 +0000 | |
---|---|---|
committer | 2017-12-06 13:48:05 +0000 | |
commit | 9ec9f4802b42451910c8f68391ec5c602c39688d (patch) | |
tree | bd894b010e93807d50a9a85d7ed1d9596b017c34 | |
parent | Make vmd respect owner when starting non-disabled vms. (diff) | |
download | wireguard-openbsd-9ec9f4802b42451910c8f68391ec5c602c39688d.tar.xz wireguard-openbsd-9ec9f4802b42451910c8f68391ec5c602c39688d.zip |
strdup -> bstrdup; from Michael W. Bombardieri
-rw-r--r-- | usr.bin/dc/dc.c | 5 | ||||
-rw-r--r-- | usr.bin/dc/stack.c | 6 |
2 files changed, 4 insertions, 7 deletions
diff --git a/usr.bin/dc/dc.c b/usr.bin/dc/dc.c index e2c5461b9d4..a8b598c2439 100644 --- a/usr.bin/dc/dc.c +++ b/usr.bin/dc/dc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dc.c,v 1.19 2017/11/29 14:34:17 otto Exp $ */ +/* $OpenBSD: dc.c,v 1.20 2017/12/06 13:48:05 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek <otto@drijf.net> @@ -47,8 +47,7 @@ dc_main(int argc, char *argv[]) char *buf, *p; struct stat st; - if ((buf = strdup("")) == NULL) - err(1, NULL); + buf = bstrdup(""); /* accept and ignore a single dash to be 4.4BSD dc(1) compatible */ optind = 1; optreset = 1; diff --git a/usr.bin/dc/stack.c b/usr.bin/dc/stack.c index 357acd4c808..9a312fb6d4a 100644 --- a/usr.bin/dc/stack.c +++ b/usr.bin/dc/stack.c @@ -1,4 +1,4 @@ -/* $OpenBSD: stack.c,v 1.14 2016/03/27 15:55:13 otto Exp $ */ +/* $OpenBSD: stack.c,v 1.15 2017/12/06 13:48:05 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek <otto@drijf.net> @@ -79,9 +79,7 @@ stack_dup_value(const struct value *a, struct value *copy) copy->u.num = dup_number(a->u.num); break; case BCODE_STRING: - copy->u.string = strdup(a->u.string); - if (copy->u.string == NULL) - err(1, NULL); + copy->u.string = bstrdup(a->u.string); break; } |