diff options
author | hobbs <hobbs> | 2002-10-18 00:48:21 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2002-10-18 00:48:21 (GMT) |
commit | 97ef08ff8ed0151425188a3ef32216645cf3eb54 (patch) | |
tree | b1fd7865efc0c8f6d28ef7c95440622284dfbbe3 /generic | |
parent | d7c572c8f41dac197c5a1b349fa6a4fdbc67be80 (diff) | |
download | tk-97ef08ff8ed0151425188a3ef32216645cf3eb54.zip tk-97ef08ff8ed0151425188a3ef32216645cf3eb54.tar.gz tk-97ef08ff8ed0151425188a3ef32216645cf3eb54.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; } } } |