diff options
author | Josh Triplett <josh@joshtriplett.org> | 2014-03-15 11:40:07 -0700 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2014-03-17 12:01:15 -0400 |
commit | 7b85b243b26a03744d297b4945d31131eb48e05c (patch) | |
tree | 728c9d76cb352a3a944fa00beeec774c7c35d8dd /src/udev/udev-event.c | |
parent | df97ff74562db71879cd83bb73eba9ff7dde7a7b (diff) |
Use strlen even for constant strings
GCC optimizes strlen("string constant") to a constant, even with -O0.
Thus, replace patterns like sizeof("string constant")-1 with
strlen("string constant") where possible, for clarity. In particular,
for expressions intended to add up the lengths of components going into
a string, this often makes it clearer that the expression counts the
trailing '\0' exactly once, by putting the +1 for the '\0' at the end of
the expression, rather than hidden in a sizeof in the middle of the
expression.
Diffstat (limited to 'src/udev/udev-event.c')
0 files changed, 0 insertions, 0 deletions