{"action":"created","comment":{"url":"https://api.github.com/repos/swift-nav/libswiftnav/pulls/comments/32080407","id":32080407,"diff_hunk":"@@ -142,11 +145,14 @@ static void set_reference_sat(const u8 ref_prn, sats_management_t *sats_manageme\n           j++;\n         }\n       }\n-      else if (i == sats_management->num_sats-1) {\n-        sats_management->prns[j] = old_ref;\n-      }\n     }\n+    if (set_old_yet == 0) {\n+      or_count++;\n+      sats_management->prns[j] = old_ref;\n+    }\n+    assert (or_count == 1);","path":"src/sats_management.c","position":32,"original_position":32,"commit_id":"0f953ccfb79fb6633fd69f427b65a0a6d5ed6af0","original_commit_id":"0f953ccfb79fb6633fd69f427b65a0a6d5ed6af0","user":{"login":"kovach","id":635136,"avatar_url":"https://avatars.githubusercontent.com/u/635136?v=3","gravatar_id":"","url":"https://api.github.com/users/kovach","html_url":"https://github.com/kovach","followers_url":"https://api.github.com/users/kovach/followers","following_url":"https://api.github.com/users/kovach/following{/other_user}","gists_url":"https://api.github.com/users/kovach/gists{/gist_id}","starred_url":"https://api.github.com/users/kovach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kovach/subscriptions","organizations_url":"https://api.github.com/users/kovach/orgs","repos_url":"https://api.github.com/users/kovach/repos","events_url":"https://api.github.com/users/kovach/events{/privacy}","received_events_url":"https://api.github.com/users/kovach/received_events","type":"User","site_admin":false},"body":"I maybe should take this assertion out","created_at":"2015-06-10T00:54:06Z","updated_at":"2015-06-10T00:54:06Z","html_url":"https://github.com/swift-nav/libswiftnav/pull/167#discussion_r32080407","pull_request_url":"https://api.github.com/repos/swift-nav/libswiftnav/pulls/167","_links":{"self":{"href":"https://api.github.com/repos/swift-nav/libswiftnav/pulls/comments/32080407"},"html":{"href":"https://github.com/swift-nav/libswiftnav/pull/167#discussion_r32080407"},"pull_request":{"href":"https://api.github.com/repos/swift-nav/libswiftnav/pulls/167"}}},"pull_request":{"url":"https://api.github.com/repos/swift-nav/libswiftnav/pulls/167","id":37315173,"html_url":"https://github.com/swift-nav/libswiftnav/pull/167","diff_url":"https://github.com/swift-nav/libswiftnav/pull/167.diff","patch_url":"https://github.com/swift-nav/libswiftnav/pull/167.patch","issue_url":"https://api.github.com/repos/swift-nav/libswiftnav/issues/167","number":167,"state":"open","locked":false,"title":"fixed multiple off by one bugs","user":{"login":"kovach","id":635136,"avatar_url":"https://avatars.githubusercontent.com/u/635136?v=3","gravatar_id":"","url":"https://api.github.com/users/kovach","html_url":"https://github.com/kovach","followers_url":"https://api.github.com/users/kovach/followers","following_url":"https://api.github.com/users/kovach/following{/other_user}","gists_url":"https://api.github.com/users/kovach/gists{/gist_id}","starred_url":"https://api.github.com/users/kovach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kovach/subscriptions","organizations_url":"https://api.github.com/users/kovach/orgs","repos_url":"https://api.github.com/users/kovach/repos","events_url":"https://api.github.com/users/kovach/events{/privacy}","received_events_url":"https://api.github.com/users/kovach/received_events","type":"User","site_admin":false},"body":"fixes an issue that may cause memory corruption when the ref satellite changes and the old ref is the largest prn in the sats_management struct","created_at":"2015-06-10T00:44:06Z","updated_at":"2015-06-10T00:54:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f2e424f8815e43e17c64a5ec0daae3f6e9ddf08b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/swift-nav/libswiftnav/pulls/167/commits","review_comments_url":"https://api.github.com/repos/swift-nav/libswiftnav/pulls/167/comments","review_comment_url":"https://api.github.com/repos/swift-nav/libswiftnav/pulls/comments{/number}","comments_url":"https://api.github.com/repos/swift-nav/libswiftnav/issues/167/comments","statuses_url":"https://api.github.com/repos/swift-nav/libswiftnav/statuses/0f953ccfb79fb6633fd69f427b65a0a6d5ed6af0","head":{"label":"kovach:fix_intersection","ref":"fix_intersection","sha":"0f953ccfb79fb6633fd69f427b65a0a6d5ed6af0","user":{"login":"kovach","id":635136,"avatar_url":"https://avatars.githubusercontent.com/u/635136?v=3","gravatar_id":"","url":"https://api.github.com/users/kovach","html_url":"https://github.com/kovach","followers_url":"https://api.github.com/users/kovach/followers","following_url":"https://api.github.com/users/kovach/following{/other_user}","gists_url":"https://api.github.com/users/kovach/gists{/gist_id}","starred_url":"https://api.github.com/users/kovach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kovach/subscriptions","organizations_url":"https://api.github.com/users/kovach/orgs","repos_url":"https://api.github.com/users/kovach/repos","events_url":"https://api.github.com/users/kovach/events{/privacy}","received_events_url":"https://api.github.com/users/kovach/received_events","type":"User","site_admin":false},"repo":{"id":25057091,"name":"libswiftnav","full_name":"kovach/libswiftnav","owner":{"login":"kovach","id":635136,"avatar_url":"https://avatars.githubusercontent.com/u/635136?v=3","gravatar_id":"","url":"https://api.github.com/users/kovach","html_url":"https://github.com/kovach","followers_url":"https://api.github.com/users/kovach/followers","following_url":"https://api.github.com/users/kovach/following{/other_user}","gists_url":"https://api.github.com/users/kovach/gists{/gist_id}","starred_url":"https://api.github.com/users/kovach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kovach/subscriptions","organizations_url":"https://api.github.com/users/kovach/orgs","repos_url":"https://api.github.com/users/kovach/repos","events_url":"https://api.github.com/users/kovach/events{/privacy}","received_events_url":"https://api.github.com/users/kovach/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kovach/libswiftnav","description":"A portable C library implementing GNSS related functions and algorithms.","fork":true,"url":"https://api.github.com/repos/kovach/libswiftnav","forks_url":"https://api.github.com/repos/kovach/libswiftnav/forks","keys_url":"https://api.github.com/repos/kovach/libswiftnav/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kovach/libswiftnav/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kovach/libswiftnav/teams","hooks_url":"https://api.github.com/repos/kovach/libswiftnav/hooks","issue_events_url":"https://api.github.com/repos/kovach/libswiftnav/issues/events{/number}","events_url":"https://api.github.com/repos/kovach/libswiftnav/events","assignees_url":"https://api.github.com/repos/kovach/libswiftnav/assignees{/user}","branches_url":"https://api.github.com/repos/kovach/libswiftnav/branches{/branch}","tags_url":"https://api.github.com/repos/kovach/libswiftnav/tags","blobs_url":"https://api.github.com/repos/kovach/libswiftnav/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kovach/libswiftnav/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kovach/libswiftnav/git/refs{/sha}","trees_url":"https://api.github.com/repos/kovach/libswiftnav/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kovach/libswiftnav/statuses/{sha}","languages_url":"https://api.github.com/repos/kovach/libswiftnav/languages","stargazers_url":"https://api.github.com/repos/kovach/libswiftnav/stargazers","contributors_url":"https://api.github.com/repos/kovach/libswiftnav/contributors","subscribers_url":"https://api.github.com/repos/kovach/libswiftnav/subscribers","subscription_url":"https://api.github.com/repos/kovach/libswiftnav/subscription","commits_url":"https://api.github.com/repos/kovach/libswiftnav/commits{/sha}","git_commits_url":"https://api.github.com/repos/kovach/libswiftnav/git/commits{/sha}","comments_url":"https://api.github.com/repos/kovach/libswiftnav/comments{/number}","issue_comment_url":"https://api.github.com/repos/kovach/libswiftnav/issues/comments{/number}","contents_url":"https://api.github.com/repos/kovach/libswiftnav/contents/{+path}","compare_url":"https://api.github.com/repos/kovach/libswiftnav/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kovach/libswiftnav/merges","archive_url":"https://api.github.com/repos/kovach/libswiftnav/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kovach/libswiftnav/downloads","issues_url":"https://api.github.com/repos/kovach/libswiftnav/issues{/number}","pulls_url":"https://api.github.com/repos/kovach/libswiftnav/pulls{/number}","milestones_url":"https://api.github.com/repos/kovach/libswiftnav/milestones{/number}","notifications_url":"https://api.github.com/repos/kovach/libswiftnav/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kovach/libswiftnav/labels{/name}","releases_url":"https://api.github.com/repos/kovach/libswiftnav/releases{/id}","created_at":"2014-10-10T23:40:17Z","updated_at":"2015-04-03T00:22:25Z","pushed_at":"2015-06-10T00:40:48Z","git_url":"git://github.com/kovach/libswiftnav.git","ssh_url":"git@github.com:kovach/libswiftnav.git","clone_url":"https://github.com/kovach/libswiftnav.git","svn_url":"https://github.com/kovach/libswiftnav","homepage":"","size":7813,"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":"swift-nav:master","ref":"master","sha":"24f85e95aaaebbea61543b57ceb66238d0e2e410","user":{"login":"swift-nav","id":1069835,"avatar_url":"https://avatars.githubusercontent.com/u/1069835?v=3","gravatar_id":"","url":"https://api.github.com/users/swift-nav","html_url":"https://github.com/swift-nav","followers_url":"https://api.github.com/users/swift-nav/followers","following_url":"https://api.github.com/users/swift-nav/following{/other_user}","gists_url":"https://api.github.com/users/swift-nav/gists{/gist_id}","starred_url":"https://api.github.com/users/swift-nav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swift-nav/subscriptions","organizations_url":"https://api.github.com/users/swift-nav/orgs","repos_url":"https://api.github.com/users/swift-nav/repos","events_url":"https://api.github.com/users/swift-nav/events{/privacy}","received_events_url":"https://api.github.com/users/swift-nav/received_events","type":"Organization","site_admin":false},"repo":{"id":7901696,"name":"libswiftnav","full_name":"swift-nav/libswiftnav","owner":{"login":"swift-nav","id":1069835,"avatar_url":"https://avatars.githubusercontent.com/u/1069835?v=3","gravatar_id":"","url":"https://api.github.com/users/swift-nav","html_url":"https://github.com/swift-nav","followers_url":"https://api.github.com/users/swift-nav/followers","following_url":"https://api.github.com/users/swift-nav/following{/other_user}","gists_url":"https://api.github.com/users/swift-nav/gists{/gist_id}","starred_url":"https://api.github.com/users/swift-nav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swift-nav/subscriptions","organizations_url":"https://api.github.com/users/swift-nav/orgs","repos_url":"https://api.github.com/users/swift-nav/repos","events_url":"https://api.github.com/users/swift-nav/events{/privacy}","received_events_url":"https://api.github.com/users/swift-nav/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/swift-nav/libswiftnav","description":"A portable C library implementing GNSS related functions and algorithms.","fork":false,"url":"https://api.github.com/repos/swift-nav/libswiftnav","forks_url":"https://api.github.com/repos/swift-nav/libswiftnav/forks","keys_url":"https://api.github.com/repos/swift-nav/libswiftnav/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swift-nav/libswiftnav/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swift-nav/libswiftnav/teams","hooks_url":"https://api.github.com/repos/swift-nav/libswiftnav/hooks","issue_events_url":"https://api.github.com/repos/swift-nav/libswiftnav/issues/events{/number}","events_url":"https://api.github.com/repos/swift-nav/libswiftnav/events","assignees_url":"https://api.github.com/repos/swift-nav/libswiftnav/assignees{/user}","branches_url":"https://api.github.com/repos/swift-nav/libswiftnav/branches{/branch}","tags_url":"https://api.github.com/repos/swift-nav/libswiftnav/tags","blobs_url":"https://api.github.com/repos/swift-nav/libswiftnav/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swift-nav/libswiftnav/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swift-nav/libswiftnav/git/refs{/sha}","trees_url":"https://api.github.com/repos/swift-nav/libswiftnav/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swift-nav/libswiftnav/statuses/{sha}","languages_url":"https://api.github.com/repos/swift-nav/libswiftnav/languages","stargazers_url":"https://api.github.com/repos/swift-nav/libswiftnav/stargazers","contributors_url":"https://api.github.com/repos/swift-nav/libswiftnav/contributors","subscribers_url":"https://api.github.com/repos/swift-nav/libswiftnav/subscribers","subscription_url":"https://api.github.com/repos/swift-nav/libswiftnav/subscription","commits_url":"https://api.github.com/repos/swift-nav/libswiftnav/commits{/sha}","git_commits_url":"https://api.github.com/repos/swift-nav/libswiftnav/git/commits{/sha}","comments_url":"https://api.github.com/repos/swift-nav/libswiftnav/comments{/number}","issue_comment_url":"https://api.github.com/repos/swift-nav/libswiftnav/issues/comments{/number}","contents_url":"https://api.github.com/repos/swift-nav/libswiftnav/contents/{+path}","compare_url":"https://api.github.com/repos/swift-nav/libswiftnav/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swift-nav/libswiftnav/merges","archive_url":"https://api.github.com/repos/swift-nav/libswiftnav/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swift-nav/libswiftnav/downloads","issues_url":"https://api.github.com/repos/swift-nav/libswiftnav/issues{/number}","pulls_url":"https://api.github.com/repos/swift-nav/libswiftnav/pulls{/number}","milestones_url":"https://api.github.com/repos/swift-nav/libswiftnav/milestones{/number}","notifications_url":"https://api.github.com/repos/swift-nav/libswiftnav/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swift-nav/libswiftnav/labels{/name}","releases_url":"https://api.github.com/repos/swift-nav/libswiftnav/releases{/id}","created_at":"2013-01-29T21:32:13Z","updated_at":"2015-06-01T02:31:46Z","pushed_at":"2015-06-10T00:44:06Z","git_url":"git://github.com/swift-nav/libswiftnav.git","ssh_url":"git@github.com:swift-nav/libswiftnav.git","clone_url":"https://github.com/swift-nav/libswiftnav.git","svn_url":"https://github.com/swift-nav/libswiftnav","homepage":"","size":15694,"stargazers_count":33,"watchers_count":33,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":43,"mirror_url":null,"open_issues_count":54,"forks":43,"open_issues":54,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/swift-nav/libswiftnav/pulls/167"},"html":{"href":"https://github.com/swift-nav/libswiftnav/pull/167"},"issue":{"href":"https://api.github.com/repos/swift-nav/libswiftnav/issues/167"},"comments":{"href":"https://api.github.com/repos/swift-nav/libswiftnav/issues/167/comments"},"review_comments":{"href":"https://api.github.com/repos/swift-nav/libswiftnav/pulls/167/comments"},"review_comment":{"href":"https://api.github.com/repos/swift-nav/libswiftnav/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/swift-nav/libswiftnav/pulls/167/commits"},"statuses":{"href":"https://api.github.com/repos/swift-nav/libswiftnav/statuses/0f953ccfb79fb6633fd69f427b65a0a6d5ed6af0"}}}}