015241de73fd79887c34bdc2004a2beb091157a8
angie
  Tue May 15 14:09:48 2012 -0700
Use safecpy when there are no format args for safef, to avoid stricter gcc compile warnings on Ubuntu.
diff --git src/hg/hgLogin/hgLogin.c src/hg/hgLogin/hgLogin.c
index b0e919f..fe569bf 100644
--- src/hg/hgLogin/hgLogin.c
+++ src/hg/hgLogin/hgLogin.c
@@ -94,31 +94,31 @@
     salt[i] = seedchars[(seed[i/5] >> (i%5)*6) & 0x3f];
 encryptPWD(password, salt, buf, bufsize);
 }
 
 void findSalt(char *encPassword, char *salt, int saltSize)
 /* find the salt part from the password field */
 {
 char tempStr1[45];
 char tempStr2[45];
 int i;
 // Skip the ":B:" part
 for (i = 3; i <= strlen(encPassword); i++)
     tempStr1[i-3] = encPassword[i];
 i = strcspn(tempStr1,":");
 safencpy(tempStr2, sizeof(tempStr2), tempStr1, i);
-safef(salt, saltSize,tempStr2);
+safecpy(salt, saltSize,tempStr2);
 }
 
 bool checkPwd(char *password, char *encPassword)
 /* check an encrypted password */
 {
 char salt[14];
 int saltSize;
 saltSize = sizeof(salt);
 findSalt(encPassword, salt, saltSize);
 char encPwd[45] = "";
 encryptPWD(password, salt, encPwd, sizeof(encPwd));
 if (sameString(encPassword,encPwd))
     return TRUE;
 else
     return FALSE;
@@ -198,31 +198,31 @@
 {
 return FALSE;
 }
 
 void returnToURL(int nSec)
 /* delay for N/10  micro seconds then return to the "returnto" URL */
 {
 char *returnURL = cartUsualString(cart, "returnto", "");
 char *hgLoginHost = wikiLinkHost();
 char returnTo[512];
 
 if (!returnURL || sameString(returnURL,""))
    safef(returnTo, sizeof(returnTo),
         "http://%s/cgi-bin/hgSession?hgS_doMainPage=1", hgLoginHost);
 else
-   safef(returnTo, sizeof(returnTo), returnURL);
+   safecpy(returnTo, sizeof(returnTo), returnURL);
 
 int delay=nSec*100;
 hPrintf(
     "<script  language=\"JavaScript\">\n"
     "<!-- "
     "\n"
     "window.setTimeout(afterDelay, %d);\n"
     "function afterDelay() {\n"
     "window.location =\"%s\";\n}"
     "\n//-->\n"
     "</script>", delay, returnTo);
 }
 
 void  displayMailSuccess()
 /* display mail success confirmation box */
@@ -283,31 +283,31 @@
 
 void sendUsername(struct sqlConnection *conn, char *email)
 /* email user username(s)  */
 {
 struct sqlResult *sr;
 char **row;
 char query[256];
 
 /* find all the user names assocaited with this email address */
 char user[256];
 safef(query,sizeof(query),"select * from gbMembers where email='%s'", email);
 sr = sqlGetResult(conn, query);
 while ((row = sqlNextRow(sr)) != NULL)
     {
     struct gbMembers *m = gbMembersLoad(row);
-    safef(user, sizeof(user), m->userName);
+    safecpy(user, sizeof(user), m->userName);
     mailUsername(email, user);   
     }
 sqlFreeResult(&sr);
 }
 
 void sendNewPwdMail(char *username, char *email, char *password)
 /* send user new password */
 {
 char subject[256];
 char msg[4096];
 char signature[256]="\nUCSC Genome Browser \nhttp://www.genome.ucsc.edu ";
 char *remoteAddr=getenv("REMOTE_ADDR");
 safef(subject, sizeof(subject),"New temporary password for UCSC Genome Browse");
 safef(msg, sizeof(msg),
     "Someone (probably you, from IP address %s) requested a new password for UCSC Genome Browser (http://genome.ucsc.edu). A temporary password for user \"%s\" has been created and was set to \"%s\". If this was your intent, you will need to log in and choose a new password now. Your temporary password will expire in 7 days.\nIf someone else made this request, or if you have remembered your password, and you no longer wish to change it, you may ignore this message and continue using your old password.\n",