Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/coreutils/date.c


Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/coreutils/date.c

    r3232 r3621  
    139139
    140140#include "libbb.h"
     141#include "common_bufsiz.h"
    141142#if ENABLE_FEATURE_DATE_NANO
    142143# include <sys/syscall.h>
     
    369370
    370371#define date_buf bb_common_bufsiz1
     372    setup_common_bufsiz();
    371373    if (*fmt_dt2str == '\0') {
    372374        /* With no format string, just print a blank line */
     
    374376    } else {
    375377        /* Handle special conversions */
    376         if (strncmp(fmt_dt2str, "%f", 2) == 0) {
     378        if (is_prefixed_with(fmt_dt2str, "%f")) {
    377379            fmt_dt2str = (char*)"%Y.%m.%d-%H:%M:%S";
    378380        }
    379381        /* Generate output string */
    380         strftime(date_buf, sizeof(date_buf), fmt_dt2str, &tm_time);
     382        strftime(date_buf, COMMON_BUFSIZE, fmt_dt2str, &tm_time);
    381383    }
    382384    puts(date_buf);
Note: See TracChangeset for help on using the changeset viewer.