Skip to content

Commit

Permalink
Use qemu_strsep instead of strsep
Browse files Browse the repository at this point in the history
  • Loading branch information
VisualEhrmanntraut committed Jul 18, 2024
1 parent 6a4d304 commit 245a8f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion hw/arm/apple-silicon/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "hw/arm/apple-silicon/dtb.h"
#include "hw/arm/apple-silicon/mem.h"
#include "qapi/error.h"
#include "qemu/cutils.h"
#include "qemu/error-report.h"
#include "qemu/guest-random.h"
#include "img4.h"
Expand Down Expand Up @@ -710,7 +711,7 @@ bool xnu_contains_boot_arg(const char *bootArgs, const char *arg,
return false;
}

while ((token = strsep(&pos, " ")) != NULL) {
while ((token = qemu_strsep(&pos, " ")) != NULL) {
if (prefixmatch && strncmp(token, arg, arglen) == 0) {
return true;
} else if (strcmp(token, arg) == 0) {
Expand Down
5 changes: 3 additions & 2 deletions hw/arm/apple-silicon/dtb.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include "qemu/osdep.h"
#include "hw/arm/apple-silicon/dtb.h"
#include "qemu/cutils.h"

#define min(_a, _b) ((_a) < (_b) ? (_a) : (_b))

Expand Down Expand Up @@ -311,7 +312,7 @@ DTBNode *find_dtb_node(DTBNode *node, const char *path)

g_assert(node && path);

while (node && found && ((next = strsep(&s, "/")))) {
while (node && found && ((next = qemu_strsep(&s, "/")))) {
if (strlen(next) == 0) {
continue;
}
Expand Down Expand Up @@ -347,7 +348,7 @@ DTBNode *get_dtb_node(DTBNode *node, const char *path)

g_assert(node && path);

while (node && ((name = strsep(&s, "/")))) {
while (node && ((name = qemu_strsep(&s, "/")))) {
bool found = false;
if (strlen(name) == 0) {
continue;
Expand Down

0 comments on commit 245a8f0

Please sign in to comment.