From: Olivier Matz Date: Thu, 3 Aug 2017 20:29:56 +0000 (+0200) Subject: dump strvec X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b930282e5daf29ee377feb4cd54314c8d61a8dee;hp=f9475a730b5706ce7d20e785b1aacae375e8e7be;p=protos%2Flibecoli.git dump strvec --- diff --git a/lib/ecoli_strvec.c b/lib/ecoli_strvec.c index c50f4a6..7011cf3 100644 --- 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) { - fprintf(out, "empty strvec\n"); + fprintf(out, "none\n"); 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 */