Skip to content
This repository was archived by the owner on Jun 14, 2022. It is now read-only.

Commit fd04a0d

Browse files
committed
Code cleanup
1 parent 50c1c8b commit fd04a0d

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

src/psync/pdeviceid.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
#include <winuser.h>
2020
#include <windows.h>
2121
#elif defined(P_OS_MACOSX)
22-
#include <errno.h>
23-
#include <limits.h>
2422
#include <stdlib.h>
2523
#include <sys/utsname.h>
2624
#include <sys/sysctl.h>
@@ -90,20 +88,7 @@ static char *psync_detect_os_name() {
9088
if (uname(&un))
9189
ver = "macOS";
9290
else {
93-
v = strtol(un.release, &endptr, 0);
94-
/* out of range, extra junk at end, no conversion at all */
95-
if (errno == ERANGE || *endptr != '\0' || un.release == endptr) {
96-
log_error("failed determine OS release: %s", strerror(errno));
97-
v = 0;
98-
}
99-
#if LONG_MIN < INT_MIN || LONG_MAX > INT_MAX
100-
else if (v < INT_MIN || v > INT_MAX) {
101-
errno = ERANGE;
102-
log_error("failed determine OS release: %s", strerror(errno));
103-
v = 0;
104-
}
105-
#endif
106-
91+
v = atoi(un.release);
10792
switch (v) {
10893
case 21: ver="macOS 12 Monterey"; break;
10994
case 20: ver="macOS 11 Big Sur"; break;

0 commit comments

Comments
 (0)