diff options
author | Michael Vetter <jubalh@iodoru.org> | 2020-06-24 13:50:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-24 13:50:24 +0200 |
commit | 34be63f51434b3d2a8e7b61407d50b8277e311c4 (patch) | |
tree | 4e1a2ee9440020d1c6bd42f817a1e50ead6207ce /src/ui/notifier.c | |
parent | 5d8f3f27916e5b9efc9fce6401f83f533f8a80a8 (diff) | |
parent | 09e12a826f3e9960b2f9a8aaa9098109587e27f7 (diff) | |
download | profani-tty-34be63f51434b3d2a8e7b61407d50b8277e311c4.tar.gz |
Merge pull request #1373 from profanity-im/cygwin-notify
Fix gcc warnings for cygwin
Diffstat (limited to 'src/ui/notifier.c')
-rw-r--r-- | src/ui/notifier.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ui/notifier.c b/src/ui/notifier.c index 550416b9..a0814b47 100644 --- a/src/ui/notifier.c +++ b/src/ui/notifier.c @@ -234,20 +234,21 @@ notify(const char *const message, int timeout, const char *const category) #endif #ifdef PLATFORM_CYGWIN NOTIFYICONDATA nid; + memset(&nid, 0, sizeof(nid)); nid.cbSize = sizeof(NOTIFYICONDATA); //nid.hWnd = hWnd; nid.uID = 100; nid.uVersion = NOTIFYICON_VERSION; //nid.uCallbackMessage = WM_MYMESSAGE; nid.hIcon = LoadIcon(NULL, IDI_APPLICATION); - strncpy(nid.szTip, "Tray Icon", 10); + strcpy(nid.szTip, "Tray Icon"); nid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP; Shell_NotifyIcon(NIM_ADD, &nid); // For a Ballon Tip nid.uFlags = NIF_INFO; - strncpy(nid.szInfoTitle, "Profanity", 10); // Title - strncpy(nid.szInfo, message, 256); // Copy Tip + strcpy(nid.szInfoTitle, "Profanity"); // Title + strncpy(nid.szInfo, message, sizeof(nid.szInfo) - 1); // Copy Tip nid.uTimeout = timeout; // 3 Seconds nid.dwInfoFlags = NIIF_INFO; |