Commit Graph

10 Commits

Author SHA1 Message Date
Nicolas Williams 5f63215d0d Always perform == or != operation on cmp function result
Although not required to address bad code generation in
some versions of gcc 9 and 10, a coding style that requires
explicit comparison of the result to zero before use is
both clearer and would have avoided the generation of bad
code.

This change converts all use of cmp function usage from

```
    if (strcmp(a, b) || !strcmp(c, d)) ...
```

to

```
    if (strcmp(a, b) != 0 || strcmp(c, d)) == 0
```

for all C library cmp functions and related:

 - strcmp(), strncmp()
 - strcasecmp(), strncasecmp()
 - stricmp(), strnicmp()
 - memcmp()

Change-Id: Ic60c15e1e3a07e4faaf10648eefe3adae2543188
2021-11-24 22:30:44 -05:00
Nicolas Williams f38089257b Misc fixes (coverity) 2016-11-20 17:43:51 -06:00
Nicolas Williams 52a562a3a4 Misc fixes (coverity) 2016-11-18 22:21:45 -06:00
Nicolas Williams 1c81ddf4e2 Round #2 of scan-build warnings cleanup 2016-11-16 17:03:14 -06:00
Nicolas Williams 2fbd7331a6 Fix error-case leaks in lib/base/db.c 2015-03-24 11:50:02 -05:00
Love Hörnquist Åstrand 37afa01be3 rename roken base64, fixes #107 2014-08-22 20:57:24 -07:00
Love Hornquist Astrand 9f979d20d7 prefix json functions 2013-07-16 13:06:57 +02:00
Love Hornquist Astrand b301e47fb8 rename heim_serialize to heim_copy_serialize to follow create/copy/get semantics 2013-06-03 21:46:20 -07:00
Love Hornquist Astrand 029de6cfa4 pass back an heim_error from hx509_cert_init 2012-10-07 06:33:13 -07:00
Nicolas Williams 98809e86ce Move base into lib
This involves reverting dd267e8fc3,
    but that gets lost in the move.

    This builds on Ubuntu and Windows at this time.
2012-06-20 19:32:08 -05:00