]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/comp_scan.c
ncurses 5.9 - patch 20120225
[ncurses.git] / ncurses / tinfo / comp_scan.c
index ef604026a151c8173d2c1cd99b59273822df447a..459113bf1b972bdd6ebbe3770fd23219beeb8a53 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -50,7 +50,7 @@
 #include <ctype.h>
 #include <tic.h>
 
-MODULE_ID("$Id: comp_scan.c,v 1.93 2011/08/20 21:19:40 tom Exp $")
+MODULE_ID("$Id: comp_scan.c,v 1.96 2012/02/22 22:26:58 tom Exp $")
 
 /*
  * Maximum length of string capability we'll accept before raising an error.
@@ -213,7 +213,7 @@ next_char(void)
                    }
                } else {
                    if (used != 0)
-                       strcat(result, "\n");
+                       _nc_STRCAT(result, "\n", allocated);
                }
                if ((bufptr = bufstart) != 0) {
                    used = strlen(bufptr);
@@ -257,12 +257,12 @@ next_char(void)
 }
 
 static void
-push_back(char c)
+push_back(int c)
 /* push a character back onto the input stream */
 {
     if (bufptr == bufstart)
        _nc_syserr_abort("Can't backspace off beginning of line");
-    *--bufptr = c;
+    *--bufptr = (char) c;
     _nc_curr_col--;
 }
 
@@ -782,7 +782,7 @@ _nc_trans_string(char *ptr, char *last)
                                /* allow the digit; it'll do less harm */
                            }
                        } else {
-                           push_back((char) c);
+                           push_back(c);
                            break;
                        }
                    }
@@ -878,7 +878,7 @@ _nc_trans_string(char *ptr, char *last)
 
        if (!ignored) {
            if (_nc_curr_col <= 1) {
-               push_back((char) c);
+               push_back(c);
                c = '\n';
                break;
            }