From: otto Date: Wed, 6 Dec 2017 13:48:05 +0000 (+0000) Subject: strdup -> bstrdup; from Michael W. Bombardieri X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9ec9f4802b42451910c8f68391ec5c602c39688d;p=openbsd strdup -> bstrdup; from Michael W. Bombardieri --- 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 @@ -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 @@ -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; }