summaryrefslogtreecommitdiff
path: root/apps/app_voicemail.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2005-07-11 23:13:11 +0000
committerRussell Bryant <russell@russellbryant.com>2005-07-11 23:13:11 +0000
commit3cfa36143ea84a0fa3c9c918f04d0d7e31b580b0 (patch)
treea11e6f630d73a9bc9ba4f24624edcc293577955c /apps/app_voicemail.c
parent771f699cdd14e53ff7167eb7b683242e9cae31e0 (diff)
properly handle the return of the rowcount from ast_update_realtime (bug #4452)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_voicemail.c')
-rwxr-xr-xapps/app_voicemail.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index c65d504b1..f86346a1e 100755
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -408,8 +408,12 @@ static int change_password_realtime(struct ast_vm_user *vmu, const char *passwor
int res;
if (!ast_strlen_zero(vmu->uniqueid)) {
res = ast_update_realtime("voicemail", "uniqueid", vmu->uniqueid, "password", password, NULL);
- if (!res)
+ if (res > 0) {
ast_copy_string(vmu->password, password, sizeof(vmu->password));
+ res = 0;
+ } else if (!res) {
+ res = -1;
+ }
return res;
}
return -1;