解决一个擦除的bug

This commit is contained in:
2026-07-21 20:18:28 +08:00
parent fd13ad0e06
commit 8ab9d18c3b
25 changed files with 2005 additions and 61 deletions
+16
View File
@@ -0,0 +1,16 @@
#include <string.h>
#include <ctype.h>
#include "private/lftpd_string.h"
char *lftpd_string_trim(char *s)
{
char *p = s;
for (int i = 0, len = (int)strlen(s); i < len && isspace((int)s[i]); i++) {
p++;
}
for (int i = (int)strlen(p); i >= 0 && isspace((int)p[i]); i--) {
p[i] = '\0';
}
return p;
}