diff --git a/lib/mbsalign.c b/lib/mbsalign.c index 8fdab9ee9..c5d28de83 100644 --- a/lib/mbsalign.c +++ b/lib/mbsalign.c @@ -349,9 +349,6 @@ wc_truncate (wchar_t *wc, size_t width) return cells; } -/* FIXME: move this function to gnulib as it's missing on: - OpenBSD 3.8, IRIX 5.3, Solaris 2.5.1, mingw, BeOS */ - static int rpl_wcswidth (const wchar_t *s, size_t n) { @@ -413,8 +410,6 @@ done: static char* mbs_align_pad (char *dest, const char* dest_end, size_t n_spaces, int padchar) { - /* FIXME: Should we pad with "figure space" (\u2007) - if non ascii data present? */ for (/* nothing */; n_spaces && (dest < dest_end); n_spaces--) *dest++ = padchar; *dest = '\0'; diff --git a/libblkid/src/read.c b/libblkid/src/read.c index 89adf1167..5772b52fe 100644 --- a/libblkid/src/read.c +++ b/libblkid/src/read.c @@ -276,26 +276,6 @@ static int parse_token(char **name, char **value, char **cp) return 1; } -/* - * Extract a tag of the form value from the line. - */ -/* -static int parse_xml(char **name, char **value, char **cp) -{ - char *end; - - if (!name || !value || !cp) - return -BLKID_ERR_PARAM; - - *name = strip_line(*cp); - - if ((*name)[0] != '<' || (*name)[1] == '/') - return 0; - - FIXME: finish this. -} -*/ - /* * Extract a tag from the line. * @@ -312,8 +292,7 @@ static int parse_tag(blkid_cache cache, blkid_dev dev, char **cp) if (!cache || !dev) return -BLKID_ERR_PARAM; - if ((ret = parse_token(&name, &value, cp)) <= 0 /* && - (ret = parse_xml(&name, &value, cp)) <= 0 */) + if ((ret = parse_token(&name, &value, cp)) <= 0) return ret; DBG(READ, ul_debug("tag: %s=\"%s\"", name, value)); diff --git a/libsmartcols/src/calculate.c b/libsmartcols/src/calculate.c index a0c0dc4b9..625fe71ea 100644 --- a/libsmartcols/src/calculate.c +++ b/libsmartcols/src/calculate.c @@ -362,7 +362,7 @@ int __scols_calculate(struct libscols_table *tb, struct libscols_buffer *buf) continue; /* nothing to truncate */ - if (cl->width == 0 || width == 0) + if (cl->width == 0) continue; trunc_flag = scols_column_is_trunc(cl) diff --git a/misc-utils/logger.c b/misc-utils/logger.c index a7736ebe9..d51cd5988 100644 --- a/misc-utils/logger.c +++ b/misc-utils/logger.c @@ -775,13 +775,13 @@ static void syslog_rfc5424_header(struct logger_ctl *const ctl) if (ctl->rfc5424_time) { struct timeval tv; - struct tm *tm; + struct tm tm; logger_gettimeofday(&tv, NULL); - if ((tm = localtime(&tv.tv_sec)) != NULL) { + if (localtime_r(&tv.tv_sec, &tm) != NULL) { char fmt[64]; const size_t i = strftime(fmt, sizeof(fmt), - "%Y-%m-%dT%H:%M:%S.%%06u%z ", tm); + "%Y-%m-%dT%H:%M:%S.%%06u%z ", &tm); /* patch TZ info to comply with RFC3339 (we left SP at end) */ fmt[i - 1] = fmt[i - 2]; fmt[i - 2] = fmt[i - 3]; diff --git a/sys-utils/rtcwake.c b/sys-utils/rtcwake.c index da5ec9e3b..ec90c9cb7 100644 --- a/sys-utils/rtcwake.c +++ b/sys-utils/rtcwake.c @@ -199,9 +199,10 @@ static int get_basetimes(struct rtcwake_control *ctl, int fd) printf("\tdelta = %ld\n", ctl->sys_time - ctl->rtc_time); printf("\ttzone = %ld\n", timezone); printf("\ttzname = %s\n", tzname[daylight]); - gmtime_r(&ctl->rtc_time, &tm); + gmtime_r(&ctl->sys_time, &tm); printf("\tsystime = %ld, (UTC) %s", - (long) ctl->sys_time, asctime_r(gmtime(&ctl->sys_time), s)); + (long) ctl->sys_time, asctime_r(&tm, s)); + gmtime_r(&ctl->rtc_time, &tm); printf("\trtctime = %ld, (UTC) %s", (long) ctl->rtc_time, asctime_r(&tm, s)); }