diff options
author | Dave Brolley <brolley@redhat.com> | 2009-04-03 11:56:32 -0400 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-04-03 11:56:32 -0400 |
commit | 8d3854b9f124aa818552d462bd8cbd2577be298e (patch) | |
tree | cef962dbca12c088c6acc3edf621d4502b0012e1 /runtime/staprun/common.c | |
parent | 2f53f831393d2f0db3d54260c2a7882eff17905c (diff) | |
parent | 08dc41a50c508544bc18d384a65a137056a98195 (diff) | |
download | systemtap-steved-8d3854b9f124aa818552d462bd8cbd2577be298e.tar.gz systemtap-steved-8d3854b9f124aa818552d462bd8cbd2577be298e.tar.xz systemtap-steved-8d3854b9f124aa818552d462bd8cbd2577be298e.zip |
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Conflicts:
configure
runtime/staprun/staprun_funcs.c
Diffstat (limited to 'runtime/staprun/common.c')
-rw-r--r-- | runtime/staprun/common.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/staprun/common.c b/runtime/staprun/common.c index 8200ec9d..26b166c2 100644 --- a/runtime/staprun/common.c +++ b/runtime/staprun/common.c @@ -82,7 +82,7 @@ int stap_strfloctime(char *buf, size_t max, const char *fmt, time_t t) num = tm.tm_year % 100; goto numbering02; case 'C': - num = ((tm.tm_year + 1900 - 1) / 100) + 1; + num = ((tm.tm_year + 1900) / 100); goto numbering; case 'm': num = tm.tm_mon + 1; @@ -107,7 +107,7 @@ int stap_strfloctime(char *buf, size_t max, const char *fmt, time_t t) if (num == 0) num = 12; goto numbering02; case 'j': - ret = snprintf(c, end - c, "%03d", tm.tm_yday); + ret = snprintf(c, end - c, "%03d", tm.tm_yday + 1); if (ret < 0) return ret; c += ret; break; @@ -117,7 +117,10 @@ int stap_strfloctime(char *buf, size_t max, const char *fmt, time_t t) case 'l': num = tm.tm_hour % 12; if (num == 0) num = 12; - goto numbering; + ret = snprintf(c, end - c, "%2d", num); + if (ret < 0) return ret; + c += ret; + break; case 'M': num = tm.tm_min; goto numbering02; |