nsswitch: libpam remove depedance on locale.h use directly LOCALEDIR
[ira/wip.git] / nsswitch / pam_winbind.c
index 52a8daa1e7c77123d91d5b9bcf7b0427d19567bd..268939076b1edd3345aeadb0cc58d62ae9673884 100644 (file)
@@ -156,7 +156,7 @@ static inline void textdomain_init(void);
 static inline void textdomain_init(void)
 {
        if (!initialized) {
-               bindtextdomain(MODULE_NAME, dyn_LOCALEDIR);
+               bindtextdomain(MODULE_NAME, LOCALEDIR);
                initialized = 1;
        }
        return;
@@ -1144,7 +1144,7 @@ static bool winbind_name_list_to_sid_string_list(struct pwb_context *ctx,
        }
 
        search_location = name_list;
-       while ((comma = strstr(search_location, ",")) != NULL) {
+       while ((comma = strchr(search_location, ',')) != NULL) {
                current_name = strndup(search_location,
                                       comma - search_location);
                if (NULL == current_name) {
@@ -1199,10 +1199,8 @@ static bool winbind_name_list_to_sid_string_list(struct pwb_context *ctx,
                 * It is malformated parameter here, overwrite the last ','.
                 */
                len = strlen(sid_list_buffer);
-               if (len) {
-                       if (sid_list_buffer[len - 1] == ',') {
-                               sid_list_buffer[len - 1] = '\0';
-                       }
+               if ((len != 0) && (sid_list_buffer[len - 1] == ',')) {
+                       sid_list_buffer[len - 1] = '\0';
                }
        }