Changeset 331 for EcnlProtoTool/trunk/ntshell/ntshell/core/text_history.c
- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/ntshell/ntshell/core/text_history.c
r321 r331 33 33 #include <string.h> 34 34 #include "text_history.h" 35 #include "core/ntlibc.h" 35 36 36 37 /** … … 145 146 char *buf, const int siz) 146 147 { 147 const int text_len = strlen((const char *)text);148 const int text_len = ntlibc_strlen((const char *)text); 148 149 int found = 0; 149 150 int i; … … 151 152 int target = (p->rp + i) % TEXTHISTORY_DEPTH; 152 153 char *txtp = p->history + (TEXTHISTORY_MAXLEN * target); 153 const int target_len = strlen((const char *)txtp);154 const int target_len = ntlibc_strlen((const char *)txtp); 154 155 int comp_len = (target_len < text_len) ? target_len : text_len; 155 if (( strncmp(156 if ((ntlibc_strncmp( 156 157 (const char *)txtp, 157 158 (const char *)text, comp_len) == 0) && (comp_len > 0)) { 158 159 if (found == index) { 159 if (siz <= strlen(txtp)) {160 if (siz <= ntlibc_strlen(txtp)) { 160 161 return -1; 161 162 } 162 strcpy((char *)buf, (char *)txtp);163 ntlibc_strcpy((char *)buf, (char *)txtp); 163 164 return 0; 164 165 }
Note:
See TracChangeset
for help on using the changeset viewer.