]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/vsscanf.c
ncurses 6.4 - patch 20230923
[ncurses.git] / ncurses / base / vsscanf.c
index ef524250c36f358a7821e8c0b52603100d1a9bd9..40ee8bb1d87681456043fb02f032ae6deb3efa29 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2023 Thomas E. Dickey                                     *
  * Copyright 1998-2004,2012 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
 
 #if !HAVE_VSSCANF
 
-MODULE_ID("$Id: vsscanf.c,v 1.21 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: vsscanf.c,v 1.22 2023/09/23 18:48:57 tom Exp $")
 
 #if !(HAVE_VFSCANF || HAVE__DOSCAN)
 
 #include <ctype.h>
 
-#define L_SQUARE '['
-#define R_SQUARE ']'
-
 typedef enum {
     cUnknown
     ,cError                    /* anything that isn't ANSI */
@@ -243,7 +240,7 @@ vsscanf(const char *str, const char *format, va_list ap)
                    case sPercent:
                        if (format[n] == '%') {
                            state = sUnknown;
-                       } else if (format[n] == L_SQUARE) {
+                       } else if (format[n] == L_BLOCK) {
                            state = sLeft;
                        } else {
                            state = sNormal;
@@ -258,7 +255,7 @@ vsscanf(const char *str, const char *format, va_list ap)
                        }
                        break;
                    case sRange:
-                       if (format[n] == R_SQUARE) {
+                       if (format[n] == R_BLOCK) {
                            state = sFinal;
                            chunk = cRange;
                        }