aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/TempDataLogger/TempDataLogger.c
diff options
context:
space:
mode:
authorskullydazed <skullydazed@users.noreply.github.com>2019-07-07 10:59:58 -0700
committerGitHub <noreply@github.com>2019-07-07 10:59:58 -0700
commit04a7f66421ac141a8927491fa61e4f8e425accad (patch)
tree027bafce1cd12c31e84a758bea24d5fdb78226cb /Projects/TempDataLogger/TempDataLogger.c
parentd0fd80affba97b37eb00c650e87cb5982a4f260e (diff)
parent57edb9b0976fad82bfd0384b16c6c3269e0d19ce (diff)
downloadlufa-04a7f66421ac141a8927491fa61e4f8e425accad.tar.gz
lufa-04a7f66421ac141a8927491fa61e4f8e425accad.tar.bz2
lufa-04a7f66421ac141a8927491fa61e4f8e425accad.zip
Merge pull request #2 from drashna/master
Update LUFA repo from upstream
Diffstat (limited to 'Projects/TempDataLogger/TempDataLogger.c')
-rw-r--r--Projects/TempDataLogger/TempDataLogger.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Projects/TempDataLogger/TempDataLogger.c b/Projects/TempDataLogger/TempDataLogger.c
index 1dc267a6f..463098bd6 100644
--- a/Projects/TempDataLogger/TempDataLogger.c
+++ b/Projects/TempDataLogger/TempDataLogger.c
@@ -1,13 +1,13 @@
/*
LUFA Library
- Copyright (C) Dean Camera, 2017.
+ Copyright (C) Dean Camera, 2019.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
- Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 2019 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -125,7 +125,7 @@ ISR(TIMER1_COMPA_vect, ISR_BLOCK)
char LineBuffer[100];
uint16_t BytesWritten;
- BytesWritten = sprintf(LineBuffer, "%02d/%02d/20%02d, %02d:%02d:%02d, %d Degrees\r\n",
+ BytesWritten = snprintf(LineBuffer, sizeof(LineBuffer), "%02d/%02d/20%02d, %02d:%02d:%02d, %d Degrees\r\n",
CurrentTimeDate.Day, CurrentTimeDate.Month, CurrentTimeDate.Year,
CurrentTimeDate.Hour, CurrentTimeDate.Minute, CurrentTimeDate.Second,
Temperature_GetTemperature());
@@ -168,12 +168,12 @@ int main(void)
/** Opens the log file on the Dataflash's FAT formatted partition according to the current date */
void OpenLogFile(void)
{
- char LogFileName[12];
+ char LogFileName[16];
/* Get the current date for the filename as "DDMMYY.csv" */
TimeDate_t CurrentTimeDate;
RTC_GetTimeDate(&CurrentTimeDate);
- sprintf(LogFileName, "%02d%02d%02d.csv", CurrentTimeDate.Day, CurrentTimeDate.Month, CurrentTimeDate.Year);
+ snprintf(LogFileName, sizeof(LogFileName), "%02d%02d%02d.csv", CurrentTimeDate.Day, CurrentTimeDate.Month, CurrentTimeDate.Year);
/* Mount the storage device, open the file */
f_mount(0, &DiskFATState);