ncurses 6.1 - patch 20191005
[ncurses.git] / ncurses / base / vsscanf.c
index 12df4aa3c15d4c9c3170650896852d9aada658e9..38c7926e6df2b0466d40c63fefa75e4b2fa2f99e 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2004,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            *
@@ -38,7 +38,7 @@
 
 #if !HAVE_VSSCANF
 
-MODULE_ID("$Id: vsscanf.c,v 1.16 2002/09/07 17:27:56 tom Exp $")
+MODULE_ID("$Id: vsscanf.c,v 1.20 2012/02/22 22:26:58 tom Exp $")
 
 #if !(HAVE_VFSCANF || HAVE__DOSCAN)
 
@@ -230,7 +230,7 @@ vsscanf(const char *str, const char *format, va_list ap)
                /* find a chunk */
                state = sUnknown;
                chunk = cUnknown;
-               other = cUnknown;
+               other = oUnknown;
                pointer = 0;
                for (n = 0; format[n] != 0 && state != sFinal; ++n) {
                    my_fmt[n] = format[n];
@@ -271,7 +271,7 @@ vsscanf(const char *str, const char *format, va_list ap)
                                chunk = ctest;
                            } else if ((otest = other_ch(format[n])) != oUnknown) {
                                other = otest;
-                           } else if (isalpha(format[n])) {
+                           } else if (isalpha(UChar(format[n]))) {
                                state = sFinal;
                                chunk = cError;
                            }
@@ -293,12 +293,12 @@ vsscanf(const char *str, const char *format, va_list ap)
 
                /* add %n, if the format was not that */
                if (chunk != cAssigned) {
-                   strcat(my_fmt, "%n");
+                   _nc_STRCAT(my_fmt, "%n", len_fmt);
                }
 
                switch (chunk) {
                case cAssigned:
-                   strcat(my_fmt, "%n");
+                   _nc_STRCAT(my_fmt, "%n", len_fmt);
                    pointer = &eaten;
                    break;
                case cInt: