From 4e59ebc5eb23805b596b4f60011ec233bc3f8d3f Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Sat, 30 Oct 2010 01:51:45 +0100 Subject: Fix off-by-one error in name to number lookups after multiple name phonebook changes --- blasms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blasms.c b/blasms.c index 97a37de..373296d 100644 --- a/blasms.c +++ b/blasms.c @@ -123,7 +123,7 @@ void settelnum(char* telnum, char* sms, int *offsetptr) { curname[j] = '\0'; if (!strcmp(name, curname)) { strncpy(telnum, line, offset - 1); - telnum[offset] = '\0'; + telnum[offset - 1] = '\0'; *offsetptr = *offsetptr + strlen(name) + 1; return; } else { -- cgit v1.2.3