summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx/src/svc_reminder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/UserInfoEx/src/svc_reminder.cpp')
-rw-r--r--plugins/UserInfoEx/src/svc_reminder.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp
index a5b04fc55b..f8633d1622 100644
--- a/plugins/UserInfoEx/src/svc_reminder.cpp
+++ b/plugins/UserInfoEx/src/svc_reminder.cpp
@@ -508,9 +508,11 @@ static BYTE CheckBirthday(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNoti
default:
cchMsg = mir_sntprintf(szMsg, SIZEOF(szMsg), TranslateT("%s has birthday in %d days."), DB::Contact::DisplayName(hContact), Diff);
}
- mir_sntprintf(szMsg + cchMsg, SIZEOF(szMsg) - cchMsg,
- TranslateT("\n%s becomes %d years old."),
- ContactGender(hContact), mtb.Age(&Now) + (Diff > 0));
+ int age = mtb.Age(&Now);
+ if (age > 0)
+ mir_sntprintf(szMsg + cchMsg, SIZEOF(szMsg) - cchMsg,
+ TranslateT("\n%s becomes %d years old."),
+ ContactGender(hContact), age + (Diff > 0));
NotifyWithPopup(hContact, CEvent::BIRTHDAY, Diff, mtb.Description(), szMsg);
}