diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-29 20:04:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-29 20:04:45 +0400 |
commit | 4fc84b8f15e6ac308614799a7a7b06bb55c23385 (patch) | |
tree | 18654259e2468b26f3cf62d4bce66800ca2a3605 /source/blender/editors/space_text/text_format.h | |
parent | 1cffa7f339d51a62fba0b9d273b906a522c24b65 (diff) |
text editor: replace strncmp() and hard coded size with STR_LITERAL_STARTSWITH() macro that gets the size from sizeof().
Diffstat (limited to 'source/blender/editors/space_text/text_format.h')
-rw-r--r-- | source/blender/editors/space_text/text_format.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/space_text/text_format.h b/source/blender/editors/space_text/text_format.h index 02c5f433b57..0e6c0937579 100644 --- a/source/blender/editors/space_text/text_format.h +++ b/source/blender/editors/space_text/text_format.h @@ -76,4 +76,7 @@ void ED_text_format_register(TextFormatType *tft); /* formatters */ void ED_text_format_register_py(void); +#define STR_LITERAL_STARTSWITH(str, str_literal, len_var) \ + (strncmp(str, str_literal, len_var = (sizeof(str_literal) - 1)) == 0) + #endif /* __TEXT_FORMAT_H__ */ |