[svn-commits] russell: trunk r109841 - /trunk/main/http.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Mar 18 23:09:55 CDT 2008


Author: russell
Date: Tue Mar 18 23:09:55 2008
New Revision: 109841

URL: http://svn.digium.com/view/asterisk?view=rev&rev=109841
Log:
Minor change to use Asterisk macros

Modified:
    trunk/main/http.c

Modified: trunk/main/http.c
URL: http://svn.digium.com/view/asterisk/trunk/main/http.c?view=diff&rev=109841&r1=109840&r2=109841
==============================================================================
--- trunk/main/http.c (original)
+++ trunk/main/http.c Tue Mar 18 23:09:55 2008
@@ -136,13 +136,16 @@
 static const char *ftype2mtype(const char *ftype, char *wkspace, int wkspacelen)
 {
 	int x;
+
 	if (ftype) {
-		for (x=0;x<sizeof(mimetypes) / sizeof(mimetypes[0]); x++) {
+		for (x = 0; x < ARRAY_LEN(mimetypes); x++) {
 			if (!strcasecmp(ftype, mimetypes[x].ext))
 				return mimetypes[x].mtype;
 		}
 	}
-	snprintf(wkspace, wkspacelen, "text/%s", ftype ? ftype : "plain");
+
+	snprintf(wkspace, wkspacelen, "text/%s", S_OR(ftype, "plain"));
+
 	return wkspace;
 }
 




More information about the svn-commits mailing list