diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2013-07-02 17:13:47 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2013-07-02 17:13:47 +0200 |
commit | f6df7d7e510f2d8879ec54dce32fee2b691dc32d (patch) | |
tree | 8a68d1586c3290093e9a6002ac8f071dbaf749e3 /src/main.c | |
parent | a1e73fc8d72a5253cae29c9bab5b260ad297c5e2 (diff) | |
download | pianobar-f6df7d7e510f2d8879ec54dce32fee2b691dc32d.tar.gz pianobar-f6df7d7e510f2d8879ec54dce32fee2b691dc32d.tar.bz2 pianobar-f6df7d7e510f2d8879ec54dce32fee2b691dc32d.zip |
piano: Check for libgcrypt errors
Fixes mysterious segfaults from issue #369 and #293.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -424,8 +424,14 @@ int main (int argc, char **argv) { BarSettingsInit (&app.settings); BarSettingsRead (&app.settings); - PianoInit (&app.ph, app.settings.partnerUser, app.settings.partnerPassword, - app.settings.device, app.settings.inkey, app.settings.outkey); + PianoReturn_t pret; + if ((pret = PianoInit (&app.ph, app.settings.partnerUser, + app.settings.partnerPassword, app.settings.device, + app.settings.inkey, app.settings.outkey)) != PIANO_RET_OK) { + BarUiMsg (&app.settings, MSG_ERR, "Initialization failed:" + " %s\n", PianoErrorToStr (pret)); + return 0; + } BarUiMsg (&app.settings, MSG_NONE, "Welcome to " PACKAGE " (" VERSION ")! "); |