File tree Expand file tree Collapse file tree 3 files changed +3
-7
lines changed Expand file tree Collapse file tree 3 files changed +3
-7
lines changed Original file line number Diff line number Diff line change 2121#include "common/messages.h"
2222#include "common/keymap.h"
2323
24- #if defined(_UnixOS )
25- #include <unistd.h>
26- #endif
27-
2824struct code_array_node_s {
2925 var_t * v ;
3026 var_int_t col ;
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ int v_isempty(var_t *var) {
5050 return 1 ;
5151}
5252
53- int v_strlen (var_t * v ) {
53+ int v_strlen (const var_t * v ) {
5454 int result ;
5555 if (v -> type == V_STR ) {
5656 result = v -> v .p .size ;
@@ -459,7 +459,7 @@ void v_set(var_t *dest, const var_t *src) {
459459 dest -> v .i = src -> v .i ;
460460 break ;
461461 case V_STR :
462- dest -> v .p .size = strlen (src -> v . p . ptr ) + 1 ;
462+ dest -> v .p .size = v_strlen (src ) + 1 ;
463463 dest -> v .p .ptr = (char * )malloc (dest -> v .p .size );
464464 strcpy (dest -> v .p .ptr , src -> v .p .ptr );
465465 break ;
Original file line number Diff line number Diff line change @@ -659,7 +659,7 @@ char *v_getstr(var_t *v);
659659 * @param v is the variable
660660 * @return the string length
661661 */
662- int v_strlen (var_t * v );
662+ int v_strlen (const var_t * v );
663663
664664/**
665665 * @ingroup var
You can’t perform that action at this time.
0 commit comments