Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
safe_strcmp.hpp
00001 // ArduinoJson - arduinojson.org 00002 // Copyright Benoit Blanchon 2014-2021 00003 // MIT License 00004 00005 #pragma once 00006 00007 #include <ArduinoJson/Namespace.hpp> 00008 00009 #include <stdint.h> // int8_t 00010 00011 namespace ARDUINOJSON_NAMESPACE { 00012 00013 inline int safe_strcmp(const char* a, const char* b) { 00014 if (a == b) 00015 return 0; 00016 if (!a) 00017 return -1; 00018 if (!b) 00019 return 1; 00020 return strcmp(a, b); 00021 } 00022 00023 inline int safe_strncmp(const char* a, const char* b, size_t n) { 00024 if (a == b) 00025 return 0; 00026 if (!a) 00027 return -1; 00028 if (!b) 00029 return 1; 00030 return strncmp(a, b, n); 00031 } 00032 } // namespace ARDUINOJSON_NAMESPACE
Generated on Wed Jul 13 2022 01:10:36 by
1.7.2