Skip to content

Commit

Permalink
Fix buffer overrun in example sketches.
Browse files Browse the repository at this point in the history
Closes #48.
  • Loading branch information
JChristensen committed Dec 3, 2019
1 parent a913400 commit fe01b0d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/Change_TZ_1/Change_TZ_1.ino
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ time_t compileTime()
{
const time_t FUDGE(10); //fudge factor to allow for upload time, etc. (seconds, YMMV)
const char *compDate = __DATE__, *compTime = __TIME__, *months = "JanFebMarAprMayJunJulAugSepOctNovDec";
char compMon[3], *m;
char compMon[4], *m;

strncpy(compMon, compDate, 3);
compMon[3] = '\0';
Expand Down
2 changes: 1 addition & 1 deletion examples/Change_TZ_2/Change_TZ_2.ino
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ time_t compileTime()
{
const time_t FUDGE(10); //fudge factor to allow for upload time, etc. (seconds, YMMV)
const char *compDate = __DATE__, *compTime = __TIME__, *months = "JanFebMarAprMayJunJulAugSepOctNovDec";
char compMon[3], *m;
char compMon[4], *m;

strncpy(compMon, compDate, 3);
compMon[3] = '\0';
Expand Down
2 changes: 1 addition & 1 deletion examples/Clock/Clock.ino
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ time_t compileTime()
{
const time_t FUDGE(10); // fudge factor to allow for compile time (seconds, YMMV)
const char *compDate = __DATE__, *compTime = __TIME__, *months = "JanFebMarAprMayJunJulAugSepOctNovDec";
char chMon[3], *m;
char chMon[4], *m;
tmElements_t tm;

strncpy(chMon, compDate, 3);
Expand Down
2 changes: 1 addition & 1 deletion examples/WorldClock/WorldClock.ino
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ time_t compileTime()
{
const time_t FUDGE(10); // fudge factor to allow for compile time (seconds, YMMV)
const char *compDate = __DATE__, *compTime = __TIME__, *months = "JanFebMarAprMayJunJulAugSepOctNovDec";
char chMon[3], *m;
char chMon[4], *m;
tmElements_t tm;

strncpy(chMon, compDate, 3);
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Timezone
version=1.2.2
version=1.2.3
author=Jack Christensen <[email protected]>
maintainer=Jack Christensen <[email protected]>
sentence=Arduino library to facilitate time zone conversions and automatic daylight saving (summer) time adjustments.
Expand Down

0 comments on commit fe01b0d

Please sign in to comment.