shithub: vdict

Download patch

ref: 14caf138d97d28e0455ea760708f0fc994d29873
parent: d2b51b153b7015614fda04bf30bee42afdbac230
author: phil9 <telephil9@gmail.com>
date: Wed Mar 23 03:52:46 EDT 2022

fix db/strat name parsing

--- a/dictc.c
+++ b/dictc.c
@@ -149,6 +149,7 @@
 		p += 2; /* skip <space>" */
 		p[strlen(p) - 2] = 0; /* remove "\r */
 		e->desc = strdup(p);
+		p -= 2;
 		*p = '\0';
 		e->name = strdup(s);
 		dvadd(c->db, e);
@@ -190,6 +191,7 @@
 		p += 2; /* skip <space>" */
 		p[strlen(p) - 2] = 0; /* remove "\r */
 		e->desc = strdup(p);
+		p -= 2;
 		*p = '\0';
 		e->name = strdup(s);
 		dvadd(c->strat, e);
@@ -317,7 +319,7 @@
 	Dvec *v;
 	Response r;
 	Definition *d;
-	char buf[1024];
+	char buf[1024] = {0};
 	int rc, n, i;
 
 	snprint(buf, sizeof buf, "DEFINE %s \"%s\"", db, word);