You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by fu...@apache.org on 2007/04/05 19:06:30 UTC

svn commit: r525888 - /httpd/mod_ftp/trunk/modules/ftp/ftp_log.c

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";
     }
 }