From 833927d3499640a6c748081ce4d18d3e93755213 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Thu, 4 Jan 2018 17:06:58 -0800 Subject: [PATCH] SCP: Cleanup compiler warnings --- scp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scp.c b/scp.c index f0fe2ff9..17606dbd 100644 --- a/scp.c +++ b/scp.c @@ -3030,7 +3030,8 @@ if ((*cptr == '"') || (*cptr == '\'')) { return SCPE_2MARG; /* No more arguments */ if (SCPE_OK != sim_decode_quoted_string (gbuf, dbuf, &dsize)) return sim_messagef (SCPE_ARG, "Invalid String\n"); - cptr = dbuf; + dbuf[dsize] = 0; + cptr = (char *)dbuf; } sim_printf ("%s%s", cptr, (sim_switches & SWMASK('N')) ? "" : "\n"); return SCPE_OK; @@ -3376,7 +3377,8 @@ if ((*ip == '"') || (*ip == '\'')) { /* start with a quot if (*cptr == '\0') { /* full string was quoted? */ uint32 dsize; - if (SCPE_OK == sim_decode_quoted_string (tp, tp, &dsize)) { + if (SCPE_OK == sim_decode_quoted_string (tp, (uint8 *)tp, &dsize)) { + tp[dsize] = '\0'; while (sim_isspace (*tp)) memmove (tp, tp + 1, strlen (tp)); strlcpy (ip, tp, instr_size - (ip - instr));/* copy quoted contents to input buffer */