aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2014-04-18 23:28:26 +0200
committerMarc Hoersken <info@marc-hoersken.de>2014-04-18 23:28:26 +0200
commit667d133dab461ceabc2698d04700d2eeb6c83eee (patch)
tree6e2218514aef5d9a86b24785fa762e2987d47d77 /src
parente81bdab13eda838b864148f307acc549444fb57d (diff)
tool_urlglob.c: added some comments to clarify for loop conditions
I was tempted to change those to >= 0 until I saw that this is actually a for loop that terminates once i underflows.
Diffstat (limited to 'src')
-rw-r--r--src/tool_urlglob.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tool_urlglob.c b/src/tool_urlglob.c
index 943e0ab88..4419cfa4b 100644
--- a/src/tool_urlglob.c
+++ b/src/tool_urlglob.c
@@ -465,6 +465,7 @@ void glob_cleanup(URLGlob* glob)
size_t i;
int elem;
+ /* the < condition is required since i underflows! */
for(i = glob->size - 1; i < glob->size; --i) {
if((glob->pattern[i].type == UPTSet) &&
(glob->pattern[i].content.Set.elements)) {
@@ -498,6 +499,7 @@ int glob_next_url(char **globbed, URLGlob *glob)
/* implement a counter over the index ranges of all patterns,
starting with the rightmost pattern */
+ /* the < condition is required since i underflows! */
for(i = glob->size - 1; carry && (i < glob->size); --i) {
carry = FALSE;
pat = &glob->pattern[i];