myadm

Simple MySQL client for the terminal
git clone git://git.bitsmanent.org/myadm
Log | Files | Refs | README | LICENSE

commit c366cfaf3b40e0b1fc9b97bc56494f9fb19e9f26
parent a9a8689504afa7635d358213cee89222063a0794
Author: Claudio Alessi <smoppy@gmail.com>
Date:   Sat, 23 Apr 2016 19:50:11 +0200

MySQL already returns null-terminated rows.

Though we must take this[0] into account:

"You cannot treat these as null-terminated strings if field values may contain
binary data, because such values may contain null bytes internally."

[0]https://dev.mysql.com/doc/refman/5.7/en/c-api-data-structures.html

Diffstat:
Mmyadm.c | 1-
1 file changed, 0 insertions(+), 1 deletion(-)

diff --git a/myadm.c b/myadm.c @@ -535,7 +535,6 @@ mysql_items(MYSQL_RES *res, Item **items) { for(i = 0; i < nfds; ++i) { item->cols[i] = ecalloc(lens[i], sizeof(char) + 1); memcpy(item->cols[i], row[i], lens[i]); - item->cols[i][ lens[i] ] = '\0'; item->lens[i] = lens[i]; } attachitem(item, items);