summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bratch <l_bratch@yahoo.co.uk>2010-10-30 01:51:45 +0100
committerLuke Bratch <l_bratch@yahoo.co.uk>2010-10-30 01:51:45 +0100
commit4e59ebc5eb23805b596b4f60011ec233bc3f8d3f (patch)
tree59493ce8280d7f54d61a6d8152291fda092a518d
parent9df202451be8699dd32cbbd715acb9b5b547c6b1 (diff)
Fix off-by-one error in name to number lookups after multiple name phonebook changes
-rw-r--r--blasms.c2
1 files changed, 1 insertions, 1 deletions
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 {