X-Git-Url: https://oss.titaniummirror.com/gitweb?p=msp430-binutils.git;a=blobdiff_plain;f=libiberty%2Fstrsignal.c;fp=libiberty%2Fstrsignal.c;h=666b1b4f15e577ec2d18cb68fbea0c7f9777accf;hp=4ca9e21d1133b565ad64c75b06cafeb6d6bf03aa;hb=88750007d7869f178f0ba528f41efd3b74c424cf;hpb=6df9443a374e2b81278c61b8afc0a1eef7db280b diff --git a/libiberty/strsignal.c b/libiberty/strsignal.c index 4ca9e21..666b1b4 100644 --- a/libiberty/strsignal.c +++ b/libiberty/strsignal.c @@ -404,10 +404,10 @@ call to @code{strsignal}. #ifndef HAVE_STRSIGNAL -const char * +char * strsignal (int signo) { - const char *msg; + char *msg; static char buf[32]; #ifndef HAVE_SYS_SIGLIST @@ -428,14 +428,16 @@ strsignal (int signo) { /* In range, but no sys_siglist or no entry at this index. */ sprintf (buf, "Signal %d", signo); - msg = (const char *) buf; + msg = buf; } else { - /* In range, and a valid message. Just return the message. */ - msg = (const char *) sys_siglist[signo]; + /* In range, and a valid message. Just return the message. We + can safely cast away const, since POSIX says the user must + not modify the result. */ + msg = (char *) sys_siglist[signo]; } - + return (msg); }