Skip to content

Commit

Permalink
We fixed a segmentation fault for in the string
Browse files Browse the repository at this point in the history
  • Loading branch information
kamanashisroy committed Apr 19, 2014
1 parent 501adb5 commit c7a5574
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ stamp-h1
*.gcno
coverage
lcov.info

.version.h
*~
1 change: 1 addition & 0 deletions aroop/compiler/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
valac
aroopc
*.h
*.c
Makefile
2 changes: 1 addition & 1 deletion aroop/core/inc/core/txt.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ aroop_txt_t*xultb_subtxt(aroop_txt_t*src, int off, int width, aroop_txt_t*dest);

#define aroop_txt_equals_static(x,static_y) ({char static_text[] = static_y;((x) && (x)->len == (sizeof(static_y)-1) && !memcmp((x)->str, static_text,(x)->len));})
#define aroop_txt_equals_chararray(x,y) ({((!(x) && !(y)) || ((x) && !(x)->str && !(y) )) || ((x) && !strcmp((x)->str, y));})
#define aroop_txt_zero_terminate(x) ({if((x)->len < (x)->size && (x)->str != NULL) (x)->str[(x)->len] = '\0';})
#define aroop_txt_zero_terminate(x) ({if((x)->len < (x)->size && (x)->str != NULL && (x)->str[(x)->len] != '\0') (x)->str[(x)->len] = '\0';})
#define aroop_txt_is_zero_terminated(x) ({((x)->len < (x)->size && (x)->str != NULL && (x)->str[(x)->len] == '\0');})

#define aroop_txt_printf(x, ...) ({(x)->len = snprintf((x)->str, (x)->size - 1, __VA_ARGS__);})
Expand Down

0 comments on commit c7a5574

Please sign in to comment.