diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 7ca0132e6fdff654b50b04bb637209cf4aaa51eb..5d8e8f9c986524751199ef75d35f8836fb979b91 100755
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -772,6 +772,8 @@ static int retrieve_file(char *dir, int msgnum)
 							SQLFreeHandle (SQL_HANDLE_STMT, stmt);
 							goto yuck;
 						}
+						fdlen = colsize;
+						ftruncate(fd, fdlen);
 					}
 				} else {
 					res = SQLGetData(stmt, x + 1, SQL_CHAR, rowdata, sizeof(rowdata), NULL);
@@ -780,7 +782,6 @@ static int retrieve_file(char *dir, int msgnum)
 						SQLFreeHandle (SQL_HANDLE_STMT, stmt);
 						goto yuck;
 					}
-					printf("Got field '%s'\n", coltitle);
 					if (strcmp(coltitle, "msgnum") && strcmp(coltitle, "dir") && f)
 						fprintf(f, "%s=%s\n", coltitle, rowdata);
 				}