Module Name:    src
Committed By:   gutteridge
Date:           Thu Apr 20 22:23:53 UTC 2023

Modified Files:
        src/usr.bin/resize: resize.h

Log Message:
resize.c: use estrdup(3) with basename(3)

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.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/resize/resize.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/resize/resize.h
diff -u src/usr.bin/resize/resize.h:1.2 src/usr.bin/resize/resize.h:1.3
--- src/usr.bin/resize/resize.h:1.2	Sun Feb 28 00:44:58 2021
+++ src/usr.bin/resize/resize.h	Thu Apr 20 22:23:53 2023
@@ -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.
@@ -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

Reply via email to