aboutsummaryrefslogtreecommitdiff
path: root/src/userspace/libc/string/strinv.c
blob: 38f0b78bec56e22f57304f1fda710919c25632ca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdint.h>
#include <string.h>

void strinv(char *str)
{
	u8 s_str = strlen(str);

	int iterations = (int)s_str / 2;
	for (int i = 0; i < iterations; i++) {
		char aux = str[i];
		str[i] = str[(s_str - i) - 1];
		str[(s_str - i) - 1] = aux;
	}
}