diff options
author | hobbs <hobbs> | 2002-10-18 00:48:21 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2002-10-18 00:48:21 (GMT) |
commit | d03bc5c12d63cd1b014ffe6dcb23bb242b65e453 (patch) | |
tree | b1fd7865efc0c8f6d28ef7c95440622284dfbbe3 /generic | |
parent | 49e5f064fe4ae37926721fb362f22d4f21849cf5 (diff) | |
download | tk-d03bc5c12d63cd1b014ffe6dcb23bb242b65e453.zip tk-d03bc5c12d63cd1b014ffe6dcb23bb242b65e453.tar.gz tk-d03bc5c12d63cd1b014ffe6dcb23bb242b65e453.tar.bz2 |
* tests/imgPhoto.test:
* generic/tkImgPhoto.c (ImgPhotoConfigureMaster): fix arg handling
for missing -format or -data options. [Bug #624974]
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkImgPhoto.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index f470835..8379f1d 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -16,7 +16,7 @@ * Department of Computer Science, * Australian National University. * - * RCS: @(#) $Id: tkImgPhoto.c,v 1.35 2002/10/09 09:32:24 dkf Exp $ + * RCS: @(#) $Id: tkImgPhoto.c,v 1.36 2002/10/18 00:48:22 hobbs Exp $ */ #include "tkInt.h" @@ -1841,16 +1841,24 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags) args[j] = Tcl_GetStringFromObj(objv[i], &length); if ((length > 1) && (args[j][0] == '-')) { if ((args[j][1] == 'd') && - !strncmp(args[j],"-data", (size_t) length)) { - if (i < objc) { - data = objv[++i]; + !strncmp(args[j], "-data", (size_t) length)) { + if (++i < objc) { + data = objv[i]; j--; + } else { + Tcl_AppendResult(interp, + "value for \"-data\" missing", (char *) NULL); + return TCL_ERROR; } } else if ((args[j][1] == 'f') && - !strncmp(args[j],"-format", (size_t) length)) { - if (i < objc) { - format = objv[++i]; + !strncmp(args[j], "-format", (size_t) length)) { + if (++i < objc) { + format = objv[i]; j--; + } else { + Tcl_AppendResult(interp, + "value for \"-format\" missing", (char *) NULL); + return TCL_ERROR; } } } |