]> git.draconx.ca Git - cdecl99.git/commit
libcdecl: Avoid using strcpy w/ empty strings.
authorNick Bowler <nbowler@draconx.ca>
Thu, 20 Jul 2023 01:15:14 +0000 (21:15 -0400)
committerNick Bowler <nbowler@draconx.ca>
Thu, 20 Jul 2023 01:15:14 +0000 (21:15 -0400)
commit28f34e6425c63edd0db0e20effda20e1e71ba193
tree6dc620df6966c0f7f90924a2ca9ffdd183039487
parentb126a7b2d76bffbe16dd439b8049898442191536
libcdecl: Avoid using strcpy w/ empty strings.

The parser is currently using strcpy to copy constant empty strings; it
is just as easy to explicitly assign the single zero byte instead.

Since these are the only use of strcpy in the library, and for whatever
reason GCC is not optimizing out these strcpy calls, on ELF hosts this
saves a PLT entry in the shared library and everything associated with
that too.
src/parse.y