fix How to convert const char* to char*

-> Use of const_cast<> to strip const
This commit is contained in:
6543 2019-03-22 00:44:59 +01:00
parent 1349de1ba3
commit fac5131e82

View File

@ -206,7 +206,7 @@ size_t bencode_path2list(const char *pathname, FILE *fp)
if( bencode_begin_list(fp) != 1 ) return 0; if( bencode_begin_list(fp) != 1 ) return 0;
for(; *p;){ for(; *p;){
pn = strchr(p, PATH_SP); pn = const_cast<char *>(strchr(p, PATH_SP));
if( pn ){ if( pn ){
if( bencode_buf(p, pn - p, fp) != 1) return 0; if( bencode_buf(p, pn - p, fp) != 1) return 0;
p = pn + 1; p = pn + 1;