summaryrefslogtreecommitdiffhomepage
path: root/Private/Source/Network/IP.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Private/Source/Network/IP.cpp')
-rw-r--r--Private/Source/Network/IP.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/Private/Source/Network/IP.cpp b/Private/Source/Network/IP.cpp
index 4e8f602a..f58e59b6 100644
--- a/Private/Source/Network/IP.cpp
+++ b/Private/Source/Network/IP.cpp
@@ -1,7 +1,7 @@
/*
* ========================================================
*
- * NewKit
+ * HCore
* Copyright 2024 Mahrouss Logic, all rights reserved.
*
* ========================================================
@@ -10,7 +10,7 @@
#include <NetworkKit/IP.hpp>
#include <NewKit/Utils.hpp>
-namespace hCore {
+namespace HCore {
char* RawIPAddress::Address() { return m_Addr; }
RawIPAddress::RawIPAddress(char bytes[4]) { rt_copy_memory(bytes, m_Addr, 4); }
@@ -34,7 +34,8 @@ bool RawIPAddress::operator!=(const RawIPAddress& ipv4) {
char& RawIPAddress::operator[](const Size& index) {
kcout << "[RawIPAddress::operator[]] Fetching Index...\r\n";
- if (index > 4) panic(RUNTIME_CHECK_EXPRESSION);
+ static char IP_PLACEHOLDER = '0';
+ if (index > 4) return IP_PLACEHOLDER;
return m_Addr[index];
}
@@ -46,7 +47,8 @@ RawIPAddress6::RawIPAddress6(char bytes[8]) {
char& RawIPAddress6::operator[](const Size& index) {
kcout << "[RawIPAddress6::operator[]] Fetching Index...\r\n";
- if (index > 8) panic(RUNTIME_CHECK_EXPRESSION);
+ static char IP_PLACEHOLDER = '0';
+ if (index > 8) return IP_PLACEHOLDER;
return m_Addr[index];
}
@@ -92,4 +94,4 @@ bool IPFactory::IpCheckVersion4(const char* ip) {
return true;
}
-} // namespace hCore
+} // namespace HCore