X-Git-Url: https://git.distorted.org.uk/~mdw/tig/blobdiff_plain/e77aa656c6003eb56d55ce514a1826466b351564..b86250daae850bc6f456df3f520a706501347b75:/tig.c diff --git a/tig.c b/tig.c index 933d083..c96faae 100644 --- a/tig.c +++ b/tig.c @@ -1219,9 +1219,10 @@ set_option(char *opt, char *value) /* Tokenize */ while (argc < ARRAY_SIZE(argv) && (valuelen = strcspn(value, " \t"))) { argv[argc++] = value; - value += valuelen; - if (!*value) + + /* Nothing more to tokenize or last available token. */ + if (!*value || argc >= ARRAY_SIZE(argv)) break; *value++ = 0;