winetest: consistent constraint on tag length
Ferenc Wagner
wferi at tba.elte.hu
Fri Apr 1 03:48:52 CST 2005
ChangeLog: Use the same maximum length for tags given on the
command line and tags entered in the GUI.
Feri.
Index: programs/winetest/gui.c
===================================================================
RCS file: /home/wine/wine/programs/winetest/gui.c,v
retrieving revision 1.7
diff -u -r1.7 gui.c
--- programs/winetest/gui.c 31 Mar 2005 15:22:41 -0000 1.7
+++ programs/winetest/gui.c 1 Apr 2005 09:45:56 -0000
@@ -328,7 +328,7 @@
switch (LOWORD (wParam)) {
case IDOK:
len = GetWindowTextLengthA (GetDlgItem (hwnd, IDC_TAG));
- if (len <= 20) { /* keep it consistent with IDD_TAG */
+ if (len <= MAXTAGLEN) {
tag = xmalloc (len+1);
GetDlgItemTextA (hwnd, IDC_TAG, tag, len+1);
if (!badtagchar (tag)) EndDialog (hwnd, IDOK);
Index: programs/winetest/main.c
===================================================================
RCS file: /home/wine/wine/programs/winetest/main.c,v
retrieving revision 1.33
diff -u -r1.33 main.c
--- programs/winetest/main.c 31 Mar 2005 15:22:41 -0000 1.33
+++ programs/winetest/main.c 1 Apr 2005 09:45:57 -0000
@@ -597,6 +598,9 @@
break;
case 't':
tag = strtok (NULL, whitespace);
+ if (strlen (tag) > MAXTAGLEN)
+ report (R_FATAL, "tag is too long (maximum %d characters)",
+ MAXTAGLEN);
cp = badtagchar (tag);
if (cp) {
report (R_ERROR, "invalid char in tag: %c", *cp);
Index: programs/winetest/winetest.h
===================================================================
RCS file: /home/wine/wine/programs/winetest/winetest.h,v
retrieving revision 1.6
diff -u -r1.6 winetest.h
--- programs/winetest/winetest.h 31 Mar 2005 15:22:41 -0000 1.6
+++ programs/winetest/winetest.h 1 Apr 2005 09:45:57 -0000
@@ -57,6 +57,7 @@
R_QUIET
};
+#define MAXTAGLEN 20
extern char *tag;
int guiAskTag (void);
int report (enum report_type t, ...);
More information about the wine-patches
mailing list