From: Chris Allegretta Date: Mon, 4 Mar 2002 18:12:28 +0000 (+0000) Subject: Minor fix for quote code, forgot to adjust null by qdepth X-Git-Tag: v1.1.7~7 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=6324530ec8dda66ea6fab9368963d28c5094eb86;p=nano.git Minor fix for quote code, forgot to adjust null by qdepth git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1098 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/nano.c b/nano.c index d12f99bc..814b6f2b 100644 --- a/nano.c +++ b/nano.c @@ -2356,13 +2356,12 @@ int do_justify(void) len2 = strlen(current->data + i + 1); tmpline->data = charalloc(len2 + 1 + qdepth); - tmpline->data[0] = '\0'; for (j = 0; j < qdepth; j += strlen(quotestr)) strcpy(&tmpline->data[j], quotestr); /* Skip the white space in current. */ memcpy(&tmpline->data[j], current->data + i + 1, len2); - tmpline->data[len2] = '\0'; + tmpline->data[len2 + qdepth] = '\0'; current->data = nrealloc(current->data, i + 1);