Changeset 442 for EcnlProtoTool/trunk/ntshell/ntshell/core/text_history.c
- Timestamp:
- Jul 13, 2020, 8:07:55 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/ntshell/ntshell/core/text_history.c
r331 r442 146 146 char *buf, const int siz) 147 147 { 148 const int text_len = ntlibc_strlen((const char *)text);148 const int text_len = strlen((const char *)text); 149 149 int found = 0; 150 150 int i; … … 152 152 int target = (p->rp + i) % TEXTHISTORY_DEPTH; 153 153 char *txtp = p->history + (TEXTHISTORY_MAXLEN * target); 154 const int target_len = ntlibc_strlen((const char *)txtp);154 const int target_len = strlen((const char *)txtp); 155 155 int comp_len = (target_len < text_len) ? target_len : text_len; 156 if (( ntlibc_strncmp(156 if ((strncmp( 157 157 (const char *)txtp, 158 158 (const char *)text, comp_len) == 0) && (comp_len > 0)) { 159 159 if (found == index) { 160 if (siz <= ntlibc_strlen(txtp)) {160 if (siz <= strlen(txtp)) { 161 161 return -1; 162 162 } 163 ntlibc_strcpy((char *)buf, (char *)txtp);163 strcpy((char *)buf, (char *)txtp); 164 164 return 0; 165 165 }
Note:
See TracChangeset
for help on using the changeset viewer.