ncurses 6.2 - patch 20210418
[ncurses.git] / ncurses / base / vsscanf.c
index 4d082ee422d462a73762c256064e61f81fb29c5a..ef524250c36f358a7821e8c0b52603100d1a9bd9 100644 (file)
@@ -1,5 +1,6 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc.              *
+ * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 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            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -38,7 +39,7 @@
 
 #if !HAVE_VSSCANF
 
 
 #if !HAVE_VSSCANF
 
-MODULE_ID("$Id: vsscanf.c,v 1.17 2003/05/24 21:10:28 tom Exp $")
+MODULE_ID("$Id: vsscanf.c,v 1.21 2020/02/02 23:34:34 tom Exp $")
 
 #if !(HAVE_VFSCANF || HAVE__DOSCAN)
 
 
 #if !(HAVE_VFSCANF || HAVE__DOSCAN)
 
@@ -271,7 +272,7 @@ vsscanf(const char *str, const char *format, va_list ap)
                                chunk = ctest;
                            } else if ((otest = other_ch(format[n])) != oUnknown) {
                                other = otest;
                                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;
                            }
                                state = sFinal;
                                chunk = cError;
                            }
@@ -293,12 +294,12 @@ vsscanf(const char *str, const char *format, va_list ap)
 
                /* add %n, if the format was not that */
                if (chunk != cAssigned) {
 
                /* 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:
                }
 
                switch (chunk) {
                case cAssigned:
-                   strcat(my_fmt, "%n");
+                   _nc_STRCAT(my_fmt, "%n", len_fmt);
                    pointer = &eaten;
                    break;
                case cInt:
                    pointer = &eaten;
                    break;
                case cInt: