Skip to content

Commit 3329767

Browse files
committed
AK/IpAddressCidr: Fix Kernel define
This commit: - includes Kernel/Library/MiniStdLib.h for the memcpy function - changes the to_string() function to append the KString->view() to the string builder which is a type that can be appended by try_append
1 parent 6bdfb1e commit 3329767

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

AK/IpAddressCidr.h

+9
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
#include <AK/IPv6Address.h>
1212
#include <AK/UFixedBigInt.h>
1313

14+
#ifdef KERNEL
15+
# include <Kernel/Library/MiniStdLib.h>
16+
#endif
17+
1418
namespace AK {
1519

1620
class IPv4AddressCidr;
@@ -80,7 +84,12 @@ class IPAddressCidr {
8084

8185
auto address_string = TRY(m_address.to_string());
8286

87+
#ifdef KERNEL
88+
TRY(builder.try_append(address_string->view()));
89+
#else
8390
TRY(builder.try_append(address_string));
91+
#endif
92+
8493
TRY(builder.try_append('/'));
8594
TRY(builder.try_appendff("{}", m_length));
8695

0 commit comments

Comments
 (0)