diff options
author | ache <ache@ache.one> | 2019-02-06 05:38:02 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2019-02-06 05:38:02 +0100 |
commit | dac4b31e5e5591e5dd0fbba48fa4b9fcce744c8e (patch) | |
tree | 5e873b5769d4d09512e712f336a621de0dd492fb /sms.c | |
parent | gcc11 (diff) |
Debug mode
Diffstat (limited to 'sms.c')
-rw-r--r-- | sms.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -155,7 +155,7 @@ int readSMS(char* filename, int inbox_outbox) { sms_text[++sms_len] = lastChar; getSms.text = sms_text; getSms.len = sms_len; - + int r = insertSMS(&getSms); if( r ) return 2; @@ -182,12 +182,11 @@ int listSMS(char* smsInboxDir, int inorout) { if( r ) { return 2; } - } } closedir(dirHandler); } else { - fprintf(stderr, "Directory can't be opened"); + fprintf(stderr, "Directory can't be opened: "); return 1; } return 0; @@ -198,14 +197,15 @@ int listSMS(char* smsInboxDir, int inorout) { int loadConv(void) { - int r = listSMS(config.SMS_INBOX, SMS_IN); - if( r ) { - fprintf(stderr, "Impossible de lire les SMS reçu"); + int r = 0; + + if( *config.SMS_INBOX && (r = listSMS(config.SMS_INBOX, SMS_IN)) ) { + fprintf(stderr, "Impossible de lire les SMS reçu\n"); return 1; } - r = listSMS(config.SMS_SENTBOX , SMS_OUT); - if( r ) { - fprintf(stderr, "Impossible de lire les SMS envoyés"); + ; + if( *config.SMS_SENTBOX && (r = listSMS(config.SMS_SENTBOX , SMS_OUT)) ) { + fprintf(stderr, "Impossible de lire les SMS envoyés\n"); return 2; } |