Skip to content

Commit

Permalink
Deleted zero addition
Browse files Browse the repository at this point in the history
  • Loading branch information
Clothor- committed Jul 11, 2023
1 parent 1396f9d commit 32373cb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/String/s21_memcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
void *s21_memcpy(void *dest, const void *src, s21_size_t n) {
char *source = (char *)src;
char *destination = (char *)dest;
s21_size_t i = 0;
for (; i < n; i++) {
destination[i] = source[i];
}
destination[i] = '\0';
while (len-- > 0)
*destination++ = *source;
return destination;
}
1 change: 0 additions & 1 deletion src/String/s21_to_lower.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ void *s21_to_lower(const char *str) {
copy_str[i] = str[i];
}
}
copy_str[len] = '\0';
return (copy_str);
}
1 change: 0 additions & 1 deletion src/String/s21_to_upper.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ void *s21_to_upper(const char *str) {
copy_str[i] = str[i];
}
}
copy_str[len] = '\0';
return (copy_str);
}

0 comments on commit 32373cb

Please sign in to comment.