- sprintf(str, "250-Please read the file %s\r\n"
- "250-\tIt was last modified %s - %ld days ago\r\n",
- temp, tm,
- (now - buf.st_mtime) / 86400);
- send(c->sock, str, strlen(str), 0);
- }
- globfree(&pglob);
- }
+ /* remove trailing LF */
+ tm = ctime(&buf.st_mtime);
+ tm[strlen(tm) - 1] = 0;
+
+ snprintf(str, 256, "250-Please read the file %s\r\n"
+ "250-\tIt was last modified %s - %ld days ago\r\n",
+ temp, tm,
+ (now - buf.st_mtime) / 86400);
+ send(c->sock, str, strlen(str), 0);
+ }
+ globfree(&pglob);