-
Notifications
You must be signed in to change notification settings - Fork 603
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
writeANSI: use strcpy instead of strncat
strncat(3) needs to traverse through the buffer to append the string into the end of old string. This will have a big performance penalty when we have a very large input. Replace it with strcpy(3) and a pointer to track the end of current buffer. Accidently, this change also silence gcc's -Wstringop-overflow warning, since gcc thinks our issue to strncat(3) to stop right at the NULL terminator maybe an error.
- Loading branch information
Showing
1 changed file
with
17 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters