From 25a6478553fadd5a86ab78e83c1e23642d96aed4 Mon Sep 17 00:00:00 2001 From: Mathew Date: Wed, 25 Nov 2015 06:19:59 -0500 Subject: [PATCH] Fixed username detection bug --- src/oneshot.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/oneshot.cpp b/src/oneshot.cpp index 703e30f..961a92e 100644 --- a/src/oneshot.cpp +++ b/src/oneshot.cpp @@ -258,8 +258,8 @@ Oneshot::Oneshot(const RGSSThreadData &threadData) struct passwd *pwd = getpwuid(getuid()); if (pwd) { - if (pwd->pw_gecos && pwd->pw_gecos[0] != ',') - { + if (pwd->pw_gecos && pwd->pw_gecos[0] && pwd->pw_gecos[0] != ',') + { //Get the user's full name int comma = 0; for (; pwd->pw_gecos[comma] && pwd->pw_gecos[comma] != ','; ++comma) {}