[Git][ghc/ghc][master] rts: Fix erroneous usage of vsnprintf

Marge Bot gitlab at gitlab.haskell.org
Wed Sep 16 08:54:06 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
ce42e187 by Ben Gamari at 2020-09-16T04:53:59-04:00
rts: Fix erroneous usage of vsnprintf

As pointed out in #18685, this should be snprintf not vsnprintf. This
appears to be due to a cut-and-paste error.

Fixes #18658.

- - - - -


1 changed file:

- rts/RtsMessages.c


Changes:

=====================================
rts/RtsMessages.c
=====================================
@@ -248,7 +248,7 @@ rtsSysErrorMsgFn(const char *s, va_list ap)
 
         r = vsnprintf(buf, BUFSIZE, s, ap);
         if (r > 0 && r < BUFSIZE) {
-            r = vsnprintf(buf+r, BUFSIZE-r, ": %s", syserr);
+            r = snprintf(buf+r, BUFSIZE-r, ": %s", syserr);
             MessageBox(NULL /* hWnd */,
                        buf,
                        prog_name,



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ce42e187ebfc81174ed477f247f023ae094c9b24

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ce42e187ebfc81174ed477f247f023ae094c9b24
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200916/de5b344f/attachment.html>


More information about the ghc-commits mailing list