Skip to content

Commit

Permalink
StrScan(): Copy into new buffer with MemCopy() instead of a loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Mikonos committed Jan 30, 2024
1 parent 524bdde commit 8e5f169
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Kernel/StrScan.ZC
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ and take address.
*/
U8 *buf, *ptr, **pptr;
Bool left_justify = FALSE;
I64 ch, cur_arg = 0, i, len, *i_ptr, dec_len;
I64 ch, cur_arg = 0, len, *i_ptr, dec_len;
F64 *d_ptr;

if (!format)
Expand Down Expand Up @@ -301,9 +301,9 @@ and take address.
}
}
buf = MAlloc(len + 1);
for (i = 0; i < len; i++)
buf[i] = *src++;
buf[i] = 0;
MemCopy(buf, src, len);
buf[len] = 0;
src += len;
switch (ch)
{
case 's':
Expand Down

0 comments on commit 8e5f169

Please sign in to comment.