浏览代码

Merge pull request #39 from stoeckmann/fgets

On success, fgets always terminates the result.
Aaron Marcher 9 年之前
父节点
当前提交
95ceafcae7
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      slstatus.c

+ 1 - 1
slstatus.c

@@ -447,7 +447,7 @@ run_command(const char *cmd)
 		warn("Failed to get command output for %s", cmd);
 		return smprintf("%s", UNKNOWN_STR);
 	}
-	fgets(buf, sizeof(buf) - 1, fp);
+	fgets(buf, sizeof(buf), fp);
 	pclose(fp);
 	buf[sizeof(buf) - 1] = '\0';