Use sizeof() to prevent mixups for previous commit.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1661 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
eed9bc7210
commit
67e0c58394
@ -1577,7 +1577,7 @@ load_licence(unsigned char **data)
|
|||||||
|
|
||||||
snprintf((char *) hi, 16, g_hostname);
|
snprintf((char *) hi, 16, g_hostname);
|
||||||
sec_hash_sha1_16(ho, hi, g_static_rdesktop_salt_16);
|
sec_hash_sha1_16(ho, hi, g_static_rdesktop_salt_16);
|
||||||
sec_hash_to_string(hash, 41, ho, 20);
|
sec_hash_to_string(hash, sizeof(hash), ho, sizeof(ho));
|
||||||
|
|
||||||
snprintf(path, PATH_MAX, "%s" RDESKTOP_LICENSE_STORE "/%s.cal", home, hash);
|
snprintf(path, PATH_MAX, "%s" RDESKTOP_LICENSE_STORE "/%s.cal", home, hash);
|
||||||
path[sizeof(path) - 1] = '\0';
|
path[sizeof(path) - 1] = '\0';
|
||||||
@ -1625,7 +1625,7 @@ save_licence(unsigned char *data, int length)
|
|||||||
|
|
||||||
snprintf((char *) hi, 16, g_hostname);
|
snprintf((char *) hi, 16, g_hostname);
|
||||||
sec_hash_sha1_16(ho, hi, g_static_rdesktop_salt_16);
|
sec_hash_sha1_16(ho, hi, g_static_rdesktop_salt_16);
|
||||||
sec_hash_to_string(hash, 41, ho, 20);
|
sec_hash_to_string(hash, sizeof(hash), ho, sizeof(ho));
|
||||||
|
|
||||||
/* write licence to {sha1}.cal.new, then atomically
|
/* write licence to {sha1}.cal.new, then atomically
|
||||||
rename to {sha1}.cal */
|
rename to {sha1}.cal */
|
||||||
|
Loading…
Reference in New Issue
Block a user