Why use “strlen30()” instead of “strlen()”?
问题 I've read and wondered about the source code of sqlite static int strlen30(const char *z){ const char *z2 = z; while( *z2 ){ z2++; } return 0x3fffffff & (int)(z2 - z); } Why use strlen30() instead of strlen() (in string.h)?? 回答1: The commit message that went in with this change states: [793aaebd8024896c] part of check-in [c872d55493] Never use strlen(). Use our own internal sqlite3Strlen30() which is guaranteed to never overflow an integer. Additional explicit casts to avoid nuisance warning