Skip to content

Commit

Permalink
Merge pull request #2 from SamB/strchr
Browse files Browse the repository at this point in the history
fix: `index()` -> `strchr()`
  • Loading branch information
Necoo33 authored Dec 24, 2024
2 parents 512b914 + c310a42 commit c535e13
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions c/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,16 @@ DiskInfo get_disk_info(void) {
}
while ( fgets(procline, sizeof(procline), mounts) ) {
device = procline;
mount = index(procline, ' ');
mount = strchr(procline, ' ');
if (mount == NULL) continue;
*mount++ = '\0';
type = index(mount, ' ');
type = strchr(mount, ' ');
if (type == NULL) continue;
*type++ = '\0';
mode = index(type, ' ');
mode = strchr(type, ' ');
if (mode == NULL) continue;
*mode++ = '\0';
other = index(mode, ' ');
other = strchr(mode, ' ');
if (other != NULL) *other = '\0';
if (!strncmp(mode, "ro", 2)) continue;
if (remote_mount(device, type)) continue;
Expand Down

0 comments on commit c535e13

Please sign in to comment.