diff options
-rw-r--r-- | blasms.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -18,6 +18,7 @@ */ #include <stdio.h> +#include <stdlib.h> #include <string.h> /* Remove trailing \n */ @@ -97,12 +98,14 @@ void settelnum(char* telnum, char* sms, int *offsetptr) { //printf("Name match: %s\n", line); strxfrm(telnum, line, offset); telnum[offset] = '\0'; - break; + *offsetptr = *offsetptr + strlen(name) + 1; + return; } } } - *offsetptr = *offsetptr + strlen(name) + 1; + printf("Error: %s not found in phonebook.conf.\n", name); + exit(1); } int main(int argc, char *argv[]) { |