summaryrefslogtreecommitdiffstats
path: root/src/intrf.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-11-16 12:53:21 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2008-11-16 12:53:21 +0100
commit07b1742903d2b483ca4afc1d39d1b644eb755e5a (patch)
treea72a91c3d25247474c5c91e5ce30a85c3e23d64d /src/intrf.c
parent8453cfff02206ad932e8ddd3c24b34aa7c42af62 (diff)
Code cleanup after using LLVM/Clang Static Analyzer
Diffstat (limited to 'src/intrf.c')
-rw-r--r--src/intrf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/intrf.c b/src/intrf.c
index a8eefca..1082316 100644
--- a/src/intrf.c
+++ b/src/intrf.c
@@ -235,7 +235,7 @@ const char *aff_part_aux(const unsigned int newline, const disk_t *disk_car, con
if(partition->partname[0]!='\0')
pos+=snprintf(&msg[pos],sizeof(msg)-pos-1, " [%s]",partition->partname);
if(partition->fsname[0]!='\0')
- pos+=snprintf(&msg[pos],sizeof(msg)-pos-1, " [%s]",partition->fsname);
+ snprintf(&msg[pos],sizeof(msg)-pos-1, " [%s]",partition->fsname);
return msg;
}
@@ -1195,8 +1195,10 @@ static char *filename_to_directory(const char *filename)
buf[sizeof(buf)-1]='\0';
#endif
res=dirname(buf);
+ if(res==NULL)
+ return NULL;
#ifdef HAVE_GETCWD
- if(res!=NULL && strcmp(res,".")==0 && getcwd(buf, sizeof(buf)-1)!=NULL)
+ if(strcmp(res,".")==0 && getcwd(buf, sizeof(buf)-1)!=NULL)
{
buf[sizeof(buf)-1]='\0';
res=buf;