aboutsummaryrefslogtreecommitdiff
path: root/smbutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'smbutil.c')
-rw-r--r--smbutil.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/smbutil.c b/smbutil.c
index 7f609f7f..97217a8d 100644
--- a/smbutil.c
+++ b/smbutil.c
@@ -388,7 +388,7 @@ unistr(netdissect_options *ndo, char (*buf)[MAX_UNISTR_SIZE+1],
}
}
if (!use_unicode) {
- while (strsize != 0) {
+ while (strsize != 0) {
c = GET_U_1(s);
s++;
strsize--;
@@ -768,9 +768,8 @@ smb_fdata1(netdissect_options *ndo,
case 'T':
{
time_t t;
- struct tm *lt;
const char *tstring;
- char buffer[sizeof("Www Mmm dd hh:mm:ss yyyy\n")];
+ char buffer[sizeof("Www Mmm dd hh:mm:ss yyyyy")];
uint32_t x;
switch (atoi(fmt + 1)) {
@@ -800,16 +799,11 @@ smb_fdata1(netdissect_options *ndo,
break;
}
if (t != 0) {
- lt = localtime(&t);
- if (lt != NULL) {
- strftime(buffer, sizeof(buffer), "%a %b %e %T %Y%n", lt);
- tstring = buffer;
- }
- else
- tstring = "(Can't convert time)\n";
+ tstring = nd_format_time(buffer, sizeof(buffer), "%a %b %e %T %Y",
+ localtime(&t));
} else
- tstring = "NULL\n";
- ND_PRINT("%s", tstring);
+ tstring = "NULL";
+ ND_PRINT("%s\n", tstring);
fmt++;
while (ND_ASCII_ISDIGIT(*fmt))
fmt++;