fix compiler warnings

Origin commit data
------------------
Branch: master
Commit: cd387592d0
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2020-01-09 (Thu, 09 Jan 2020)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2020-01-09 21:32:07 +01:00
committed by vanhofen
parent 5b15371965
commit f7b8539ee2
5 changed files with 13 additions and 8 deletions

View File

@@ -36,8 +36,10 @@ hw_caps_t *get_hwcaps(void)
caps.display_has_statusline = 0;
strcpy(caps.boxvendor, "Generic");
strcpy(caps.boxname, "PC");
if (! uname(&u))
if (! uname(&u)){
strncpy(caps.boxarch, u.machine, sizeof(caps.boxarch));
caps.boxarch[sizeof(caps.boxarch)-1] = '\0';
}
else
fprintf(stderr, "%s: uname() failed: %m\n", __func__);