{"action":"created","comment":{"url":"https://api.github.com/repos/notsecure/uTox/pulls/comments/32365249","id":32365249,"diff_hunk":"@@ -324,33 +324,37 @@ static _Bool init_avatar(AVATAR *avatar, const char_t *id, uint8_t *png_data_out\n     }\n     return 0;\n }\n-\n static size_t load_save(uint8_t **out_data){\n     uint8_t path[UTOX_FILE_NAME_LENGTH], *p, *data;\n-    uint32_t size;\n+    char savename[UTOX_FILE_NAME_LENGTH];\n \n+    uint32_t size;\n+    const unsigned int tox_savename_len = strlen(tox_savename);\n     do{ /* Try the STS compliant save location */\n         p = path + datapath(path);\n-        strcpy((char*)p, \"tox_save.tox\");\n+        memcpy(savename, tox_savename, tox_savename_len);\n+        memcpy(savename+tox_savename_len, \".tox\", sizeof(\".tox\")); /* Add tox extension */\n+        memcpy((char*)p, savename, tox_savename_len+sizeof(\".tox\"));\n         data = file_raw((char*)path, &size);\n         if(data) break; /* We have data, were done here! */\n         /* Try filename missing the .tox extension */\n         p = path + datapath(path);\n-        strcpy((char*)p, \"tox_save\");\n+        memcpy((char*)p, tox_savename, tox_savename_len+1);\n         data = file_raw((char*)path, &size);\n         if(data) break;\n         /* That didn't work, do we have a backup? */\n         p = path + datapath(path);\n-        strcpy((char*)p, \"tox_save.tmp\");\n+        memcpy(savename+tox_savename_len, \".tmp\", sizeof(\".tmp\"));\n+        memcpy((char*)p, savename, tox_savename_len+sizeof(\".tmp\"));\n         data = file_raw((char*)path, &size);\n         if(data) break;\n         /* No backup huh? Is it in an old location we support? */\n         p = path + datapath_old(path);\n-        strcpy((char*)p, \"tox_save\");\n+        memcpy((char*)p, tox_savename, tox_savename_len+1);\n         data = file_raw((char*)path, &size);\n         if(data) break;\n         /* Well, lets try the current directory... */\n-        data = file_raw(\"tox_save\", &size);","path":"tox.c","position":40,"original_position":40,"commit_id":"60c4a1ecfb2df5de506672fc58c2d4c692e802d4","original_commit_id":"da036c4ec6f3471e8edf81a6957c3cc762287f90","user":{"login":"GrayHatter","id":243408,"avatar_url":"https://avatars.githubusercontent.com/u/243408?v=3","gravatar_id":"","url":"https://api.github.com/users/GrayHatter","html_url":"https://github.com/GrayHatter","followers_url":"https://api.github.com/users/GrayHatter/followers","following_url":"https://api.github.com/users/GrayHatter/following{/other_user}","gists_url":"https://api.github.com/users/GrayHatter/gists{/gist_id}","starred_url":"https://api.github.com/users/GrayHatter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrayHatter/subscriptions","organizations_url":"https://api.github.com/users/GrayHatter/orgs","repos_url":"https://api.github.com/users/GrayHatter/repos","events_url":"https://api.github.com/users/GrayHatter/events{/privacy}","received_events_url":"https://api.github.com/users/GrayHatter/received_events","type":"User","site_admin":false},"body":"@SmoothDude yeah, that's why I want you to keep this line, but the ones above need to be reverted. The line on 349 needs to be reverted, because that's the OLD savelocation utox used. no user should ever expect their save file to be there, and if it is, they're wrong and need to move it. Line 353 you can keep, because it's looking in the current directory. Line 344 you'd have to keep incase utox crashes while it's trying to save the file.... or see my next comment...","created_at":"2015-06-13T00:25:23Z","updated_at":"2015-06-13T00:25:23Z","html_url":"https://github.com/notsecure/uTox/pull/1010#discussion_r32365249","pull_request_url":"https://api.github.com/repos/notsecure/uTox/pulls/1010","_links":{"self":{"href":"https://api.github.com/repos/notsecure/uTox/pulls/comments/32365249"},"html":{"href":"https://github.com/notsecure/uTox/pull/1010#discussion_r32365249"},"pull_request":{"href":"https://api.github.com/repos/notsecure/uTox/pulls/1010"}}},"pull_request":{"url":"https://api.github.com/repos/notsecure/uTox/pulls/1010","id":34591306,"html_url":"https://github.com/notsecure/uTox/pull/1010","diff_url":"https://github.com/notsecure/uTox/pull/1010.diff","patch_url":"https://github.com/notsecure/uTox/pull/1010.patch","issue_url":"https://api.github.com/repos/notsecure/uTox/issues/1010","number":1010,"state":"open","locked":false,"title":"Add abillity to select tox's save file through command line","user":{"login":"SmoothDude","id":12208948,"avatar_url":"https://avatars.githubusercontent.com/u/12208948?v=3","gravatar_id":"","url":"https://api.github.com/users/SmoothDude","html_url":"https://github.com/SmoothDude","followers_url":"https://api.github.com/users/SmoothDude/followers","following_url":"https://api.github.com/users/SmoothDude/following{/other_user}","gists_url":"https://api.github.com/users/SmoothDude/gists{/gist_id}","starred_url":"https://api.github.com/users/SmoothDude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SmoothDude/subscriptions","organizations_url":"https://api.github.com/users/SmoothDude/orgs","repos_url":"https://api.github.com/users/SmoothDude/repos","events_url":"https://api.github.com/users/SmoothDude/events{/privacy}","received_events_url":"https://api.github.com/users/SmoothDude/received_events","type":"User","site_admin":false},"body":"Just launch utox --save mysave and it will load \"mysave\" or will create a new save under name \"mysave\". Also fixed bug, where saved theme in Window's version never loaded.","created_at":"2015-05-02T20:35:16Z","updated_at":"2015-06-13T00:25:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c88b992b6367135c22b04619e316790c9190855d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/notsecure/uTox/pulls/1010/commits","review_comments_url":"https://api.github.com/repos/notsecure/uTox/pulls/1010/comments","review_comment_url":"https://api.github.com/repos/notsecure/uTox/pulls/comments{/number}","comments_url":"https://api.github.com/repos/notsecure/uTox/issues/1010/comments","statuses_url":"https://api.github.com/repos/notsecure/uTox/statuses/60c4a1ecfb2df5de506672fc58c2d4c692e802d4","head":{"label":"SmoothDude:master","ref":"master","sha":"60c4a1ecfb2df5de506672fc58c2d4c692e802d4","user":{"login":"SmoothDude","id":12208948,"avatar_url":"https://avatars.githubusercontent.com/u/12208948?v=3","gravatar_id":"","url":"https://api.github.com/users/SmoothDude","html_url":"https://github.com/SmoothDude","followers_url":"https://api.github.com/users/SmoothDude/followers","following_url":"https://api.github.com/users/SmoothDude/following{/other_user}","gists_url":"https://api.github.com/users/SmoothDude/gists{/gist_id}","starred_url":"https://api.github.com/users/SmoothDude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SmoothDude/subscriptions","organizations_url":"https://api.github.com/users/SmoothDude/orgs","repos_url":"https://api.github.com/users/SmoothDude/repos","events_url":"https://api.github.com/users/SmoothDude/events{/privacy}","received_events_url":"https://api.github.com/users/SmoothDude/received_events","type":"User","site_admin":false},"repo":{"id":34945303,"name":"uTox","full_name":"SmoothDude/uTox","owner":{"login":"SmoothDude","id":12208948,"avatar_url":"https://avatars.githubusercontent.com/u/12208948?v=3","gravatar_id":"","url":"https://api.github.com/users/SmoothDude","html_url":"https://github.com/SmoothDude","followers_url":"https://api.github.com/users/SmoothDude/followers","following_url":"https://api.github.com/users/SmoothDude/following{/other_user}","gists_url":"https://api.github.com/users/SmoothDude/gists{/gist_id}","starred_url":"https://api.github.com/users/SmoothDude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SmoothDude/subscriptions","organizations_url":"https://api.github.com/users/SmoothDude/orgs","repos_url":"https://api.github.com/users/SmoothDude/repos","events_url":"https://api.github.com/users/SmoothDude/events{/privacy}","received_events_url":"https://api.github.com/users/SmoothDude/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SmoothDude/uTox","description":"Lightweight Tox client","fork":true,"url":"https://api.github.com/repos/SmoothDude/uTox","forks_url":"https://api.github.com/repos/SmoothDude/uTox/forks","keys_url":"https://api.github.com/repos/SmoothDude/uTox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SmoothDude/uTox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SmoothDude/uTox/teams","hooks_url":"https://api.github.com/repos/SmoothDude/uTox/hooks","issue_events_url":"https://api.github.com/repos/SmoothDude/uTox/issues/events{/number}","events_url":"https://api.github.com/repos/SmoothDude/uTox/events","assignees_url":"https://api.github.com/repos/SmoothDude/uTox/assignees{/user}","branches_url":"https://api.github.com/repos/SmoothDude/uTox/branches{/branch}","tags_url":"https://api.github.com/repos/SmoothDude/uTox/tags","blobs_url":"https://api.github.com/repos/SmoothDude/uTox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SmoothDude/uTox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SmoothDude/uTox/git/refs{/sha}","trees_url":"https://api.github.com/repos/SmoothDude/uTox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SmoothDude/uTox/statuses/{sha}","languages_url":"https://api.github.com/repos/SmoothDude/uTox/languages","stargazers_url":"https://api.github.com/repos/SmoothDude/uTox/stargazers","contributors_url":"https://api.github.com/repos/SmoothDude/uTox/contributors","subscribers_url":"https://api.github.com/repos/SmoothDude/uTox/subscribers","subscription_url":"https://api.github.com/repos/SmoothDude/uTox/subscription","commits_url":"https://api.github.com/repos/SmoothDude/uTox/commits{/sha}","git_commits_url":"https://api.github.com/repos/SmoothDude/uTox/git/commits{/sha}","comments_url":"https://api.github.com/repos/SmoothDude/uTox/comments{/number}","issue_comment_url":"https://api.github.com/repos/SmoothDude/uTox/issues/comments{/number}","contents_url":"https://api.github.com/repos/SmoothDude/uTox/contents/{+path}","compare_url":"https://api.github.com/repos/SmoothDude/uTox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SmoothDude/uTox/merges","archive_url":"https://api.github.com/repos/SmoothDude/uTox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SmoothDude/uTox/downloads","issues_url":"https://api.github.com/repos/SmoothDude/uTox/issues{/number}","pulls_url":"https://api.github.com/repos/SmoothDude/uTox/pulls{/number}","milestones_url":"https://api.github.com/repos/SmoothDude/uTox/milestones{/number}","notifications_url":"https://api.github.com/repos/SmoothDude/uTox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SmoothDude/uTox/labels{/name}","releases_url":"https://api.github.com/repos/SmoothDude/uTox/releases{/id}","created_at":"2015-05-02T11:29:34Z","updated_at":"2015-05-06T16:38:41Z","pushed_at":"2015-06-11T16:21:19Z","git_url":"git://github.com/SmoothDude/uTox.git","ssh_url":"git@github.com:SmoothDude/uTox.git","clone_url":"https://github.com/SmoothDude/uTox.git","svn_url":"https://github.com/SmoothDude/uTox","homepage":"utox.org","size":3975,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"notsecure:master","ref":"master","sha":"9633f43848e7467250aebf8ec048666a1663e1a3","user":{"login":"notsecure","id":6959538,"avatar_url":"https://avatars.githubusercontent.com/u/6959538?v=3","gravatar_id":"","url":"https://api.github.com/users/notsecure","html_url":"https://github.com/notsecure","followers_url":"https://api.github.com/users/notsecure/followers","following_url":"https://api.github.com/users/notsecure/following{/other_user}","gists_url":"https://api.github.com/users/notsecure/gists{/gist_id}","starred_url":"https://api.github.com/users/notsecure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notsecure/subscriptions","organizations_url":"https://api.github.com/users/notsecure/orgs","repos_url":"https://api.github.com/users/notsecure/repos","events_url":"https://api.github.com/users/notsecure/events{/privacy}","received_events_url":"https://api.github.com/users/notsecure/received_events","type":"User","site_admin":false},"repo":{"id":17775355,"name":"uTox","full_name":"notsecure/uTox","owner":{"login":"notsecure","id":6959538,"avatar_url":"https://avatars.githubusercontent.com/u/6959538?v=3","gravatar_id":"","url":"https://api.github.com/users/notsecure","html_url":"https://github.com/notsecure","followers_url":"https://api.github.com/users/notsecure/followers","following_url":"https://api.github.com/users/notsecure/following{/other_user}","gists_url":"https://api.github.com/users/notsecure/gists{/gist_id}","starred_url":"https://api.github.com/users/notsecure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notsecure/subscriptions","organizations_url":"https://api.github.com/users/notsecure/orgs","repos_url":"https://api.github.com/users/notsecure/repos","events_url":"https://api.github.com/users/notsecure/events{/privacy}","received_events_url":"https://api.github.com/users/notsecure/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/notsecure/uTox","description":"Lightweight Tox client","fork":false,"url":"https://api.github.com/repos/notsecure/uTox","forks_url":"https://api.github.com/repos/notsecure/uTox/forks","keys_url":"https://api.github.com/repos/notsecure/uTox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/notsecure/uTox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/notsecure/uTox/teams","hooks_url":"https://api.github.com/repos/notsecure/uTox/hooks","issue_events_url":"https://api.github.com/repos/notsecure/uTox/issues/events{/number}","events_url":"https://api.github.com/repos/notsecure/uTox/events","assignees_url":"https://api.github.com/repos/notsecure/uTox/assignees{/user}","branches_url":"https://api.github.com/repos/notsecure/uTox/branches{/branch}","tags_url":"https://api.github.com/repos/notsecure/uTox/tags","blobs_url":"https://api.github.com/repos/notsecure/uTox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/notsecure/uTox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/notsecure/uTox/git/refs{/sha}","trees_url":"https://api.github.com/repos/notsecure/uTox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/notsecure/uTox/statuses/{sha}","languages_url":"https://api.github.com/repos/notsecure/uTox/languages","stargazers_url":"https://api.github.com/repos/notsecure/uTox/stargazers","contributors_url":"https://api.github.com/repos/notsecure/uTox/contributors","subscribers_url":"https://api.github.com/repos/notsecure/uTox/subscribers","subscription_url":"https://api.github.com/repos/notsecure/uTox/subscription","commits_url":"https://api.github.com/repos/notsecure/uTox/commits{/sha}","git_commits_url":"https://api.github.com/repos/notsecure/uTox/git/commits{/sha}","comments_url":"https://api.github.com/repos/notsecure/uTox/comments{/number}","issue_comment_url":"https://api.github.com/repos/notsecure/uTox/issues/comments{/number}","contents_url":"https://api.github.com/repos/notsecure/uTox/contents/{+path}","compare_url":"https://api.github.com/repos/notsecure/uTox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/notsecure/uTox/merges","archive_url":"https://api.github.com/repos/notsecure/uTox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/notsecure/uTox/downloads","issues_url":"https://api.github.com/repos/notsecure/uTox/issues{/number}","pulls_url":"https://api.github.com/repos/notsecure/uTox/pulls{/number}","milestones_url":"https://api.github.com/repos/notsecure/uTox/milestones{/number}","notifications_url":"https://api.github.com/repos/notsecure/uTox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/notsecure/uTox/labels{/name}","releases_url":"https://api.github.com/repos/notsecure/uTox/releases{/id}","created_at":"2014-03-15T12:52:31Z","updated_at":"2015-06-12T17:52:14Z","pushed_at":"2015-06-13T00:14:56Z","git_url":"git://github.com/notsecure/uTox.git","ssh_url":"git@github.com:notsecure/uTox.git","clone_url":"https://github.com/notsecure/uTox.git","svn_url":"https://github.com/notsecure/uTox","homepage":"utox.org","size":16918,"stargazers_count":551,"watchers_count":551,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":150,"mirror_url":null,"open_issues_count":202,"forks":150,"open_issues":202,"watchers":551,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/notsecure/uTox/pulls/1010"},"html":{"href":"https://github.com/notsecure/uTox/pull/1010"},"issue":{"href":"https://api.github.com/repos/notsecure/uTox/issues/1010"},"comments":{"href":"https://api.github.com/repos/notsecure/uTox/issues/1010/comments"},"review_comments":{"href":"https://api.github.com/repos/notsecure/uTox/pulls/1010/comments"},"review_comment":{"href":"https://api.github.com/repos/notsecure/uTox/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/notsecure/uTox/pulls/1010/commits"},"statuses":{"href":"https://api.github.com/repos/notsecure/uTox/statuses/60c4a1ecfb2df5de506672fc58c2d4c692e802d4"}}}}