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) {}