summaryrefslogtreecommitdiffstats
path: root/src/pacman/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pacman/util.c')
-rw-r--r--src/pacman/util.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 557696b0..b0824cfb 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -143,7 +143,7 @@ int rmrf(const char *path)
if(dp->d_ino) {
char name[PATH_MAX];
sprintf(name, "%s/%s", path, dp->d_name);
- if(strcmp(dp->d_name, "..") && strcmp(dp->d_name, ".")) {
+ if(strcmp(dp->d_name, "..") != 0 && strcmp(dp->d_name, ".") != 0) {
errflag += rmrf(name);
}
}
@@ -690,7 +690,6 @@ void display_optdepends(pmpkg_t *pkg)
static int question(short preset, char *fmt, va_list args)
{
char response[32];
- int sresponse = sizeof(response)-1;
FILE *stream;
if(config->noconfirm) {
@@ -713,15 +712,15 @@ static int question(short preset, char *fmt, va_list args)
return(preset);
}
- if(fgets(response, sresponse, stdin)) {
+ if(fgets(response, sizeof(response), stdin)) {
strtrim(response);
if(strlen(response) == 0) {
return(preset);
}
- if(!strcasecmp(response, _("Y")) || !strcasecmp(response, _("YES"))) {
+ if(strcasecmp(response, _("Y")) == 0 || strcasecmp(response, _("YES")) == 0) {
return(1);
- } else if (!strcasecmp(response, _("N")) || !strcasecmp(response, _("NO"))) {
+ } else if (strcasecmp(response, _("N")) == 0 || strcasecmp(response, _("NO")) == 0) {
return(0);
}
}
@@ -824,7 +823,7 @@ int pm_vfprintf(FILE *stream, pmloglevel_t level, const char *format, va_list ar
#if defined(PACMAN_DEBUG)
/* If debug is on, we'll timestamp the output */
- if(config->logmask & PM_LOG_DEBUG) {
+ if(config->logmask & PM_LOG_DEBUG) {
time_t t;
struct tm *tmp;
char timestr[10] = {0};