--- ldapsync.module.orig	2010-03-25 07:00:16.000000000 -0400
+++ ldapsync.module	2010-07-28 10:01:06.000000000 -0400
@@ -130,11 +130,11 @@ function _ldapsync_sync() {
     if (function_exists('ldapgroups_user_login')) {
       ldapgroups_user_login($account);
     }
-    
+
     // Enable any blocked user who is enabled in LDAP.
     if (!$account->status) {
-      db_query("UPDATE {users} SET status = %d where uid = %", 1, $account->uid);
-      watchdog('ldapsync', 'Enabled LDAP-authentified user %name because the corresponding LDAP account is enabled.', array('%name' => $row['name']));
+      db_query("UPDATE {users} SET status = %d where uid = %d", 1, $account->uid);
+      watchdog('ldapsync', 'Enabled LDAP-authentified user %name because the corresponding LDAP account is enabled.', array('%name' => $name));
     }
   }
 
