瀏覽代碼

fixed username function (wtf happened here?)

master
Aaron Marcher 8 年之前
committed by Aaron Marcher (drkhsh)
父節點
當前提交
545f1560e6
共有 1 個檔案被更改,包括 5 行新增4 行删除
  1. +5
    -4
      slstatus.c

+ 5
- 4
slstatus.c 查看文件

@@ -455,11 +455,12 @@ username(void)
uid_t uid = geteuid();
struct passwd *pw = getpwuid(uid);

if (pw == NULL)
return smprintf("%s", pw->pw_name);
if (pw == NULL) {
warn("Could not get username");
return smprintf(UNKNOWN_STR);
}

warn("Could not get username");
return smprintf(UNKNOWN_STR);
return smprintf("%s", pw->pw_name);
}

static char *


Loading…
取消
儲存