summaryrefslogtreecommitdiff
path: root/nuttx/lib
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-08-08 15:14:10 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-08-08 15:14:10 +0000
commit709de07c24959d66bff6a68bce320bc6a5f1244c (patch)
treeaeac4a43b2b2b9e3295db83025e15ee9b9a48bf5 /nuttx/lib
parent0f44115d023b06ca7bcfaa63fd14e3c8b852ad45 (diff)
downloadpx4-nuttx-709de07c24959d66bff6a68bce320bc6a5f1244c.tar.gz
px4-nuttx-709de07c24959d66bff6a68bce320bc6a5f1244c.tar.bz2
px4-nuttx-709de07c24959d66bff6a68bce320bc6a5f1244c.zip
strftime fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2014 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/lib')
-rw-r--r--nuttx/lib/lib_strftime.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/nuttx/lib/lib_strftime.c b/nuttx/lib/lib_strftime.c
index 02cce388b..008586973 100644
--- a/nuttx/lib/lib_strftime.c
+++ b/nuttx/lib/lib_strftime.c
@@ -1,7 +1,7 @@
/****************************************************************************
* lib/lib_strftime.c
*
- * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -70,13 +70,13 @@
* Private Data
****************************************************************************/
-static const char *g_abbrevmonthname[12] =
+static const char * const g_abbrevmonthname[12] =
{
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
-static const char *g_monthname[12] =
+static const char * const g_monthname[12] =
{
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
@@ -163,12 +163,21 @@ size_t strftime(char *s, size_t max, const char *format, const struct tm *tm)
/* Handle the format character */
+ format++;
len = 0;
- value = 0;
- str = "??";
- switch (*++format)
+ switch (*format++)
{
+ /* %a: A three-letter abbreviation for the day of the week. */
+ /* %A: The full name for the day of the week. */
+
+ case 'a':
+ case 'A':
+ {
+ len = snprintf(dest, chleft, "Day"); /* Not supported */
+ }
+ break;
+
/* %h: Equivalent to %b */
case 'h':