Delete new line when iter

This commit is contained in:
Aoran Zeng
2024-12-14 20:43:19 +08:00
parent 66ad62d209
commit 603525790e
8 changed files with 24 additions and 30 deletions

View File

@@ -624,7 +624,8 @@ xy_run_iter (const char *cmd, unsigned long n, void (*iter_func) (const char *
{
if (NULL == fgets (buf, size, stream))
break;
ret = buf;
/* 存在换行的总是会把换行符读出来,删掉 */
ret = xy_str_delete_suffix (buf, "\n");
count += 1;
if (n == count)
break;