]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/comp_scan.c
ncurses 5.9 - patch 20120324
[ncurses.git] / ncurses / tinfo / comp_scan.c
index 17c42df59aa91d5d794310f5cab22a8a7156f836..a860c77ad81c0b7fe768b193b0205945a7f79824 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.94 2011/10/22 15:46:43 tom Exp $")
+MODULE_ID("$Id: comp_scan.c,v 1.97 2012/03/24 22:24:19 tom Exp $")
 
 /*
  * Maximum length of string capability we'll accept before raising an error.
@@ -196,7 +196,8 @@ next_char(void)
                    result = typeRealloc(char, allocated, result);
                    if (result == 0)
                        return (EOF);
-                   bufstart = result;
+                   if (bufstart)
+                       bufstart = result;
                }
                if (used == 0)
                    _nc_curr_file_pos = ftell(yyin);
@@ -213,7 +214,7 @@ next_char(void)
                    }
                } else {
                    if (used != 0)
-                       strcat(result, "\n");
+                       _nc_STRCAT(result, "\n", allocated);
                }
                if ((bufptr = bufstart) != 0) {
                    used = strlen(bufptr);