updated: [80a6897] cleanup: mhl_str_dir_plus_file(): int -> size_t (suggested by Andrew Borodin)



The following commit has been merged in the mc-4.6 branch:
commit 80a68972718b68c5c5ae050999b187f1676c653b
Author: Sergei Trofimovich <slyfox inbox ru>
Date:   Sun Feb 1 22:01:49 2009 +0200

    cleanup: mhl_str_dir_plus_file(): int -> size_t (suggested by Andrew Borodin)
    
    Signed-off-by: Sergei Trofimovich <slyfox inbox ru>

diff --git a/mhl/string.h b/mhl/string.h
index f4c56e5..ee74e1d 100644
--- a/mhl/string.h
+++ b/mhl/string.h
@@ -149,11 +149,11 @@ static inline char* mhl_str_dir_plus_file(const char* dirname, const char* filen
 	filename++;
 
     /* skip trailing slashes on dirname */
-    int dnlen = strlen(dirname);
-    while (dnlen && (dirname[dnlen-1]=='/'))
+    size_t dnlen = strlen(dirname);
+    while ((dnlen != 0) && (dirname[dnlen-1]=='/'))
 	dnlen--;
 
-    int fnlen = strlen(filename);
+    size_t fnlen = strlen(filename);
     char* buffer = mhl_mem_alloc_z(dnlen+fnlen+2);	/* enough space for dirname, /, filename, zero */
     char* ptr = buffer;
 

-- 
Midnight Commander Development


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]