diff options
| author | Ramsay Jones <ramsay@ramsay1.demon.co.uk> | 2009-02-18 18:52:13 +0000 |
|---|---|---|
| committer | Shawn O. Pearce <spearce@spearce.org> | 2009-03-17 18:59:26 -0700 |
| commit | a9984a4e60291958a7cf0045758f47db3d214040 (patch) | |
| tree | 42608eb49e4be32002462b51e86065368b342c05 /src/util.c | |
| parent | fc3c3a2083e9f6f89e6bd53e9420e70d1e357c9b (diff) | |
| download | libgit2-a9984a4e60291958a7cf0045758f47db3d214040.tar.gz | |
Fix some (digital-mars) compiler warnings
In particular, conditional expressions which contain an
assignment statement, where the expression type is not
explicitly made to be boolean, elicits the following
message:
warning 2: possible unintended assignment
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'src/util.c')
| -rw-r--r-- | src/util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util.c b/src/util.c index 3184a3abd..bc95d2dc8 100644 --- a/src/util.c +++ b/src/util.c @@ -67,7 +67,7 @@ int git__dirname(char *dir, size_t n, char *path) assert(dir && n > 1); - if (!path || !*path || !(s = strrchr(path, '/'))) { + if (!path || !*path || (s = strrchr(path, '/')) == NULL) { strcpy(dir, "."); return 1; } @@ -99,7 +99,7 @@ int git__basename(char *base, size_t n, char *path) } len = strlen(path); - if (!(s = strrchr(path, '/'))) { + if ((s = strrchr(path, '/')) == NULL) { if (len >= n) return GIT_ERROR; strcpy(base, path); |
