diff options
author | jinwoo.shin <jw0227.shin@samsung.com> | 2015-10-12 19:44:07 +0900 |
---|---|---|
committer | jinwoo.shin <jw0227.shin@samsung.com> | 2015-10-12 19:44:07 +0900 |
commit | 6d8f274edc773425d2ef0693aabf0479cfc10336 (patch) | |
tree | 95065135c91852c241c0b8955436da278cf1ba9a | |
parent | dd85e644924f25c943727e15170d8fa2b9208d0d (diff) | |
download | air_infosquare-6d8f274edc773425d2ef0693aabf0479cfc10336.tar.gz air_infosquare-6d8f274edc773425d2ef0693aabf0479cfc10336.tar.bz2 air_infosquare-6d8f274edc773425d2ef0693aabf0479cfc10336.zip |
Fix prevent issuessubmit/tizen/20151014.005748accepted/tizen/tv/20151014.043249
CIDs : 458538
Change-Id: I96f1637cb446a24a6f01886437f59a8b66f50866
Signed-off-by: jinwoo.shin <jw0227.shin@samsung.com>
-rw-r--r-- | src/square_view.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/square_view.c b/src/square_view.c index 9fd29e5..76f99e6 100644 --- a/src/square_view.c +++ b/src/square_view.c @@ -78,19 +78,23 @@ static void _print_user_message(struct _priv *priv) { char *message; uid_t uid; - struct passwd *passwd; - char buf[128]; + struct passwd pwd, *result; + char buf[128], str[128]; message = vconf_get_str(KEY_USER_MESSAGE); if (!message) { uid = getuid(); - passwd = getpwuid(uid); - if (passwd) { - snprintf(buf, sizeof(buf), + getpwuid_r(uid, &pwd, buf, sizeof(buf), &result); + if (result) + snprintf(str, sizeof(str), STR_DEFAULT_USER_MESSAGE, - passwd->pw_name); - message = buf; - } + pwd.pw_name); + else + snprintf(str, sizeof(str), + STR_DEFAULT_USER_MESSAGE, + ""); + + message = str; } elm_object_part_text_set(priv->base, PART_INFO_USER_MESSAGE, message); |