{"action":"created","issue":{"url":"https://api.github.com/repos/things4u/ESP-1ch-Gateway-v3.0/issues/4","repository_url":"https://api.github.com/repos/things4u/ESP-1ch-Gateway-v3.0","labels_url":"https://api.github.com/repos/things4u/ESP-1ch-Gateway-v3.0/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/things4u/ESP-1ch-Gateway-v3.0/issues/4/comments","events_url":"https://api.github.com/repos/things4u/ESP-1ch-Gateway-v3.0/issues/4/events","html_url":"https://github.com/things4u/ESP-1ch-Gateway-v3.0/issues/4","id":187512535,"number":4,"title":"Latitude data is being overwritten or misrepresented","user":{"login":"dlarue","id":3150680,"avatar_url":"https://avatars.githubusercontent.com/u/3150680?v=3","gravatar_id":"","url":"https://api.github.com/users/dlarue","html_url":"https://github.com/dlarue","followers_url":"https://api.github.com/users/dlarue/followers","following_url":"https://api.github.com/users/dlarue/following{/other_user}","gists_url":"https://api.github.com/users/dlarue/gists{/gist_id}","starred_url":"https://api.github.com/users/dlarue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlarue/subscriptions","organizations_url":"https://api.github.com/users/dlarue/orgs","repos_url":"https://api.github.com/users/dlarue/repos","events_url":"https://api.github.com/users/dlarue/events{/privacy}","received_events_url":"https://api.github.com/users/dlarue/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-05T17:56:23Z","updated_at":"2016-12-30T19:04:06Z","closed_at":null,"body":"enable Debug=2 and watch for the \"stat update\" packet with lat and lon displayed. Lon is correct while Lat is being displayed as a single digit.\r\n\r\nSwapping string initialization changes the output but no doubt there is some underlying memory allocation issue here. I now see a Lon value but the Lat value has multiple decimal points and too long.\r\n\r\nCOPY OF DEBUG MSG:\r\nstat update: <231> {\"stat\":{\"time\":\"2016-11- 5 19:56:49 CET\",\"lati\":032.7942,\"long\":-117.243032.7942,\"alti\":40,\"rxnb\":48,\"rxok\":48,\"rxfw\":0,\"ackr\":0.0,\"dwnb\":0,\"txnb\":0,\"pfrm\":\"ESP8266\",\"mail\":\"doug.larue@gmail.com\",\"desc\":\"PB_SimpleTG\"}}\r\nsendUdp 1: sent 231 bytes\r\n\r\nChange made to ESP-sc-gway30.ino:\r\nWAS:\r\n\tftoa(lat,clat,4);\t\t\t\t// Convert lat to char array with 4 decimals\r\n\tftoa(lon,clon,4);\t\t\t// As Arduino CANNOT prints floats\r\nTO:\r\n\tftoa(lon,clon,4);\t\t\t// Convert lon to char array with 4 decimals\r\n\tftoa(lat,clat,4);\t\t\t\t// As Arduino CANNOT prints floats\r\n\t"},"comment":{"url":"https://api.github.com/repos/things4u/ESP-1ch-Gateway-v3.0/issues/comments/269809408","html_url":"https://github.com/things4u/ESP-1ch-Gateway-v3.0/issues/4#issuecomment-269809408","issue_url":"https://api.github.com/repos/things4u/ESP-1ch-Gateway-v3.0/issues/4","id":269809408,"user":{"login":"dlarue","id":3150680,"avatar_url":"https://avatars.githubusercontent.com/u/3150680?v=3","gravatar_id":"","url":"https://api.github.com/users/dlarue","html_url":"https://github.com/dlarue","followers_url":"https://api.github.com/users/dlarue/followers","following_url":"https://api.github.com/users/dlarue/following{/other_user}","gists_url":"https://api.github.com/users/dlarue/gists{/gist_id}","starred_url":"https://api.github.com/users/dlarue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlarue/subscriptions","organizations_url":"https://api.github.com/users/dlarue/orgs","repos_url":"https://api.github.com/users/dlarue/repos","events_url":"https://api.github.com/users/dlarue/events{/privacy}","received_events_url":"https://api.github.com/users/dlarue/received_events","type":"User","site_admin":false},"created_at":"2016-12-30T19:04:06Z","updated_at":"2016-12-30T19:04:06Z","body":"in the esp-1ch-gway.ino file on lines 733 and 734 only 8 chars are defined for holding lat and lon values. But for those of us in areas requiring 4 digits to the left of the decimal point for longitude( -117 ) then including the /0(null) termination of the string later on in the ftoa calls on lines 764 and 765, the size of the array( 8 chars ) will be exceeded and memory corruption occurs.\r\n\r\nGiven: -117.0000 for a longitude, the code needs 10 bytes of storage, NOT 8 bytes.\r\n\r\nLines 733 and 734 need to be changed to:\r\n\tchar clat[10]={0};\r\n\tchar clon[10]={0};\r\n"}}
{"actor":{"display_login":"dlarue"}}