public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] MSP430: Fix message in sbrk.c printing binary character
@ 2020-09-03 11:43 Corinna Vinschen
0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2020-09-03 11:43 UTC (permalink / raw)
To: newlib-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=d72ea86d41e1295839de8cd9564bb8b44a8d862a
commit d72ea86d41e1295839de8cd9564bb8b44a8d862a
Author: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date: Wed Sep 2 16:16:55 2020 +0100
MSP430: Fix message in sbrk.c printing binary character
The call to write() in sbrk.c was using the wrong value for the length
argument, causing the NUL terminating character of the string to be
printed.
Diff:
---
libgloss/msp430/sbrk.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libgloss/msp430/sbrk.c b/libgloss/msp430/sbrk.c
index bbc3fb5ba..8e4339f6e 100644
--- a/libgloss/msp430/sbrk.c
+++ b/libgloss/msp430/sbrk.c
@@ -24,8 +24,8 @@ _sbrk (int adj)
if (heap + adj > sp)
{
-#define MESSAGE "Heap and stack collision\n"
- write (1, MESSAGE, sizeof MESSAGE);
+ const char * const msg = "Heap and stack collision\n";
+ write (1, msg, sizeof (msg) - 1);
abort ();
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-09-03 11:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-03 11:43 [newlib-cygwin] MSP430: Fix message in sbrk.c printing binary character 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).