[svn-commits] oej: branch oej/minivoicemail r58703 - /team/oej/minivoicemail/apps/app_minivm.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sat Mar 10 08:03:35 MST 2007


Author: oej
Date: Sat Mar 10 09:03:35 2007
New Revision: 58703

URL: http://svn.digium.com/view/asterisk?view=rev&rev=58703
Log:
mkstemps was an os/x specific function obviously

Modified:
    team/oej/minivoicemail/apps/app_minivm.c

Modified: team/oej/minivoicemail/apps/app_minivm.c
URL: http://svn.digium.com/view/asterisk/team/oej/minivoicemail/apps/app_minivm.c?view=diff&rev=58703&r1=58702&r2=58703
==============================================================================
--- team/oej/minivoicemail/apps/app_minivm.c (original)
+++ team/oej/minivoicemail/apps/app_minivm.c Sat Mar 10 09:03:35 2007
@@ -1251,21 +1251,13 @@
 /*! \brief Delete media files and attribute file */
 static int vm_delete(char *file)
 {
-	char *txt;
-	int txtsize = 0;
 	int res;
 
 	if (option_debug)
-		ast_log(LOG_DEBUG, "--- Deleting voicemail file %s\n", file);
-
-	txtsize = (strlen(file) + 5) * sizeof(char);
-	txt = (char *)alloca(txtsize);
-	/* Sprintf here would safe because we alloca'd exactly the right length,
-	 * but trying to eliminate all sprintf's anyhow
-	 */
-	snprintf(txt, txtsize, "%s", file);
-	res = unlink(txt);
-	res |=  ast_filedelete(file, NULL);
+		ast_log(LOG_DEBUG, "-_-_- Deleting voicemail file %s\n", file);
+
+	res = unlink(file);	/* Remove the meta data file */
+	res |=  ast_filedelete(file, NULL);	/* remove the media file */
 	return res;
 }
 
@@ -1549,7 +1541,7 @@
 	
 
 	/* XXX This file needs to be in temp directory */
-	txtdes = mkstemps(tmptxtfile, 4);
+	txtdes = mkstemp(tmptxtfile);
 	if (txtdes < 0) {
 		ast_log(LOG_ERROR, "Unable to create message file %s: %s\n", tmptxtfile, strerror(errno));
 		res = ast_streamfile(chan, "vm-mailboxfull", chan->language);



More information about the svn-commits mailing list