diff src/scrobbler/configure.c @ 1171:cbe5598f5de4 trunk

[svn] - keep old passwords if user doesn't change them in configuration
author desowin
date Fri, 08 Jun 2007 04:37:56 -0700
parents 238055a6cb8f
children b180f83e4388
line wrap: on
line diff
--- a/src/scrobbler/configure.c	Thu Jun 07 08:28:08 2007 -0700
+++ b/src/scrobbler/configure.c	Fri Jun 08 04:37:56 2007 -0700
@@ -59,7 +59,7 @@
                 bmp_cfg_db_set_string(cfgfile, "audioscrobbler", "username", (char *)uid);
                 bmp_cfg_db_set_string(cfgfile, "audioscrobbler", "ge_username", (char *)ge_uid);
 
-                if (pwd != NULL && pwd[0] != '\0')
+                if (pwd != NULL && pwd[0] != '\0' && strlen(pwd))
 		{
                         md5_init(&md5state);
                         md5_append(&md5state, (unsigned const char *)pwd, strlen(pwd));
@@ -68,7 +68,7 @@
                                         hexify((char*)md5pword, sizeof(md5pword)));
                 }
 
-                if (ge_pwd != NULL && ge_pwd[0] != '\0')
+                if (ge_pwd != NULL && ge_pwd[0] != '\0' && strlen(ge_pwd))
 		{
                         md5_init(&md5state);
                         md5_append(&md5state, (unsigned const char *)ge_pwd, strlen(ge_pwd));