Skip to content

Commit

Permalink
ImStrv: allow constructing from two null pointers.
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed May 3, 2024
1 parent 7b1be5d commit dd72762
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ struct ImStrv
const char* End;
ImStrv() { Begin = End = NULL; }
ImStrv(const char* b) { Begin = b; End = b ? b + strlen(b) : NULL; }
ImStrv(const char* b, const char* e){ Begin = b; End = e ? e : b + strlen(b); }
ImStrv(const char* b, const char* e){ Begin = b; End = e ? e : b ? b + strlen(b) : NULL; }
inline size_t length() const { return (size_t)(End - Begin); }
inline bool empty() const { return Begin == End; } // == "" or == NULL
inline operator bool() const { return Begin != NULL; } // return true when valid ("" is valid, NULL construction is not)
Expand Down

0 comments on commit dd72762

Please sign in to comment.