Hi Neels,
I don't quite get why is 32 used there. Also documentation and
implementation look wrong to me:
* doc talks about static buffer. That makes no sense to me, line should
be removed.
* Case of in_len=-1 is not correctly handled there.
I'd change it to:
char *osmo_quote_str_c(const void *ctx, const char *str, int in_len)
{
size_t len = in_len == -1 ? strlen(str) : in_len;
len += 2;
char *buf = talloc_size(ctx, len);
if (!buf)
return NULL;
return osmo_quote_str_buf2(buf, len, str, in_len);
}
--
- Pau Espin Pedrol <pespin(a)sysmocom.de>
http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte