Print this page
3471 cscope-fast writes constant strings when erroring

@@ -26,12 +26,10 @@
 /*
  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident   "%Z%%M% %I%     %E% SMI"
-
 /*
  *      cscope - interactive C symbol cross-reference
  *
  *      display functions
  */

@@ -565,12 +563,14 @@
 
 void
 putmsg(char *msg)
 {
         if (incurses == NO) {
-                *msg = tolower(*msg);
-                (void) fprintf(stderr, "cscope: %s\n", msg);
+                char *str = stralloc(msg);
+                *str = tolower(*str);
+                (void) fprintf(stderr, "cscope: %s\n", str);
+                (void) free(str);
         } else {
                 (void) move(MSGLINE, 0);
                 (void) clrtoeol();
                 (void) addstr(msg);
                 (void) refresh();