httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fua...@apache.org
Subject svn commit: r525888 - /httpd/mod_ftp/trunk/modules/ftp/ftp_log.c
Date Thu, 05 Apr 2007 17:06:30 GMT
Author: fuankg
Date: Thu Apr  5 10:06:29 2007
New Revision: 525888

URL: http://svn.apache.org/viewvc?view=rev&rev=525888
Log:
Avoid passing r->user == NULL to strcasecmp()

Modified:
    httpd/mod_ftp/trunk/modules/ftp/ftp_log.c

Modified: httpd/mod_ftp/trunk/modules/ftp/ftp_log.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/ftp_log.c?view=diff&rev=525888&r1=525887&r2=525888
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_log.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_log.c Thu Apr  5 10:06:29 2007
@@ -85,14 +85,19 @@
 
 const char *ftp_log_accessed_anonymously(request_rec *r, char *a)
 {
-    if (strcasecmp(r->user, "anonymous") == 0) {
-        return "a";
-    }
-    else if (strcasecmp(r->user, "guest") == 0) {
-        return "g";
+    if (r->user) {
+        if (strcasecmp(r->user, "anonymous") == 0) {
+            return "a";
+        }
+        else if (strcasecmp(r->user, "guest") == 0) {
+            return "g";
+        }
+        else {
+            return "r";
+        }
     }
     else {
-        return "r";
+        return "n";
     }
 }
 



Mime
View raw message