Skip to content

Commit b482b91

Browse files
committed
polishing
1 parent 45114b1 commit b482b91

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/clients/FtpGateway.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,15 +703,16 @@ ftpListParseParts(const char *buf, struct Ftp::GatewayFlags flags)
703703
break;
704704

705705
case 'm': {
706-
char *tmp;
707-
const auto seconds = strtol(ct + 1, &tmp, 10); // zero on errors
706+
char *secondsEnd;
707+
const auto secondsStart = ct + 1;
708+
const auto seconds = strtol(secondsStart, &secondsEnd, 10); // zero on errors
708709

709710
if (seconds <= 0 || seconds > std::numeric_limits<time_t>::max())
710711
break;
711712

712713
const auto tm = static_cast<time_t>(seconds);
713714

714-
Assure(tmp > ct + 1); // saw at least one digit
715+
Assure(secondsEnd > secondsStart); // saw at least greater digit
715716

716717
if (const auto cts = std::ctime(&tm)) {
717718
xfree(p->date); // TODO: properly handle multiple p->name occurrences

0 commit comments

Comments
 (0)