Remove hard coded sizes.
authorJeremy Allison <jra@samba.org>
Fri, 25 Apr 2008 15:29:08 +0000 (08:29 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 25 Apr 2008 15:29:08 +0000 (08:29 -0700)
Jeremy.

source/client/mount.cifs.c

index 1b67a5e8e6dc4319009099269b1fafa9af03d5e4..96ab4a8910e4f7521b264e13b13aa1bd79b4b302 100644 (file)
@@ -516,7 +516,7 @@ static int parse_options(char ** optionsp, int * filesys_flags)
                                printf("CIFS: invalid domain name\n");
                                return 1;       /* needs_arg; */
                        }
-                       if (strnlen(value, 65) < 65) {
+                       if (strnlen(value, DOMAIN_SIZE+1) < DOMAIN_SIZE+1) {
                                got_domain = 1;
                        } else {
                                printf("domain name too long\n");
@@ -1194,9 +1194,9 @@ int main(int argc, char ** argv)
 
        if (getenv("PASSWD")) {
                if(mountpassword == NULL)
-                       mountpassword = (char *)calloc(65,1);
+                       mountpassword = (char *)calloc(MOUNT_PASSWD_SIZE+1,1);
                if(mountpassword) {
-                       strlcpy(mountpassword,getenv("PASSWD"),MOUNT_PASSWD_SIZE);
+                       strlcpy(mountpassword,getenv("PASSWD"),MOUNT_PASSWD_SIZE+1);
                        got_password = 1;
                }
        } else if (getenv("PASSWD_FD")) {