public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/main] Cygwin: commune_process: don't use IsBadStringPtr
@ 2024-02-01 11:40 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2024-02-01 11:40 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=61fd8702969da82a8f086e9b9aaa26fc068926c0

commit 61fd8702969da82a8f086e9b9aaa26fc068926c0
Author:     Corinna Vinschen <corinna@vinschen.de>
AuthorDate: Wed Jan 31 19:41:25 2024 +0100
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Wed Jan 31 20:11:58 2024 +0100

    Cygwin: commune_process: don't use IsBadStringPtr
    
    IsBadStringPtr is deprecated and just gives a wrong sense
    of memory safety.  Replace with check for NULL pointer.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/pinfo.cc | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index f6a9712a4164..5fd11f570c3c 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -646,10 +646,7 @@ commune_process (void *arg)
 
 	for (int i = 0; i < __argc_safe; i++)
 	  {
-	    if (IsBadStringPtr (__argv[i], INT32_MAX))
-	      argv[i] = "";
-	    else
-	      argv[i] = __argv[i];
+	    argv[i] = __argv[i] ?: "";
 	    n += strlen (argv[i]) + 1;
 	  }
 	argv[__argc_safe] = NULL;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-01 11:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-01 11:40 [newlib-cygwin/main] Cygwin: commune_process: don't use IsBadStringPtr Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).