Skip to content

Commit

Permalink
resize.c: use estrdup(3) with basename(3)
Browse files Browse the repository at this point in the history
basename(3) is invoked more than once on different paths. Retain the
correct name for the utility itself on error. Addresses PR bin/57355
from RVP, who provided the patch.
  • Loading branch information
dhgutteridge committed Apr 20, 2023
1 parent fd9580d commit df34ba1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions usr.bin/resize/resize.h
@@ -1,4 +1,4 @@
/* $NetBSD: resize.h,v 1.2 2021/02/28 00:44:58 christos Exp $ */
/* $NetBSD: resize.h,v 1.3 2023/04/20 22:23:53 gutteridge Exp $ */

/*-
* Copyright (c) 2021 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -60,7 +60,7 @@
#define TTYSIZE_COLS(ws) (ws).ws_col
#define SET_TTYSIZE(fd, ws) ioctl((fd), TIOCSWINSZ, &(ws))

#define x_basename(a) basename(a)
#define x_basename(a) estrdup(basename(a))
#define x_strdup(a) estrdup(a)
#define x_getenv(a) getenv(a)
#define x_getlogin(u, p) __nothing
Expand Down

0 comments on commit df34ba1

Please sign in to comment.