Merged revisions 160207 via svnmerge from
[asterisk/asterisk.git] / apps / app_voicemail.c
index 33abd7c..b24a904 100644 (file)
@@ -2843,7 +2843,9 @@ static int retrieve_file(char *dir, int msgnum)
                                                        }
                                                }
                                        }
                                                        }
                                                }
                                        }
-                                       truncate(full_fn, fdlen);
+                                       if (truncate(full_fn, fdlen) < 0) {
+                                               ast_log(LOG_WARNING, "Unable to truncate '%s': %s\n", full_fn, strerror(errno));
+                                       }
                                }
                        } else {
                                res = SQLGetData(stmt, x + 1, SQL_CHAR, rowdata, sizeof(rowdata), NULL);
                                }
                        } else {
                                res = SQLGetData(stmt, x + 1, SQL_CHAR, rowdata, sizeof(rowdata), NULL);