Explorar o código

[str.h] Fixing str_slice size calculation

Vinicius Teshima hai 1 ano
pai
achega
1e4e132dc3
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/str.h

+ 1 - 1
src/str.h

@@ -142,7 +142,7 @@ str_slice(struct str str, size_t from, size_t to)
 	     + ( to <= str.size ) * to;
 	
 	str.data += from;
-	str.size = from - to;
+	str.size = to - from;
 
 	return str;