diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-27 10:01:01 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-27 10:01:01 +0100 |
commit | 1502a8b4cebe66870d188cda393a620fd48f0f3b (patch) | |
tree | 1b3cdb1a2e7a3868fb99278936afc36b6b909256 | |
parent | 12450dbeef1afee5ed27f8f3a2395edbdc7a9355 (diff) | |
download | busybox-w32-1502a8b4cebe66870d188cda393a620fd48f0f3b.tar.gz busybox-w32-1502a8b4cebe66870d188cda393a620fd48f0f3b.tar.bz2 busybox-w32-1502a8b4cebe66870d188cda393a620fd48f0f3b.zip |
libbb/xrealloc_vector.c: better comment
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | libbb/xrealloc_vector.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libbb/xrealloc_vector.c b/libbb/xrealloc_vector.c index bbd5ab8ac..98fa9678e 100644 --- a/libbb/xrealloc_vector.c +++ b/libbb/xrealloc_vector.c | |||
@@ -20,8 +20,9 @@ | |||
20 | * idx step, plus one: if idx == 0x20, vector[] is resized to 0x31, | 20 | * idx step, plus one: if idx == 0x20, vector[] is resized to 0x31, |
21 | * thus last usable element is vector[0x30]. | 21 | * thus last usable element is vector[0x30]. |
22 | * | 22 | * |
23 | * In other words: after xrealloc_vector(v, 4, idx) it's ok to use | 23 | * In other words: after xrealloc_vector(v, 4, idx), with any idx, |
24 | * at least v[idx] and v[idx+1], for all idx values. | 24 | * it's ok to use at least v[idx] and v[idx+1]. |
25 | * v[idx+2] etc generally are not ok. | ||
25 | * | 26 | * |
26 | * New elements are zeroed out, but only if realloc was done | 27 | * New elements are zeroed out, but only if realloc was done |
27 | * (not on every call). You can depend on v[idx] and v[idx+1] being | 28 | * (not on every call). You can depend on v[idx] and v[idx+1] being |