git.droids-corp.org
/
protos
/
libecoli.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f9475a7
)
dump strvec
author
Olivier Matz
<zer0@droids-corp.org>
Thu, 3 Aug 2017 20:29:56 +0000
(22:29 +0200)
committer
Olivier Matz
<zer0@droids-corp.org>
Thu, 3 Aug 2017 20:29:56 +0000
(22:29 +0200)
lib/ecoli_strvec.c
patch
|
blob
|
history
diff --git
a/lib/ecoli_strvec.c
b/lib/ecoli_strvec.c
index
c50f4a6
..
7011cf3
100644
(file)
--- a/
lib/ecoli_strvec.c
+++ b/
lib/ecoli_strvec.c
@@
-161,14
+161,19
@@
void ec_strvec_dump(FILE *out, const struct ec_strvec *strvec)
size_t i;
if (strvec == NULL) {
size_t i;
if (strvec == NULL) {
- fprintf(out, "
empty strvec
\n");
+ fprintf(out, "
none
\n");
return;
}
return;
}
- fprintf(out, "strvec:\n");
- for (i = 0; i < ec_strvec_len(strvec); i++)
- fprintf(out, " %zd: %s (refcnt=%d)\n", i,
- strvec->vec[i]->str, strvec->vec[i]->refcnt);
+ fprintf(out, "strvec (len=%zu) [", strvec->len);
+ for (i = 0; i < ec_strvec_len(strvec); i++) {
+ if (i == 0)
+ fprintf(out, "%s", strvec->vec[i]->str);
+ else
+ fprintf(out, ", %s", strvec->vec[i]->str);
+ }
+ fprintf(out, "]\n");
+
}
/* XXX test case */
}
/* XXX test case */