aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/lib/string/strinv.c
blob: b4b4212029d8b52892bd2c71f68aa64d7a1c0067 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <kernel/lib/string.h>

void strinv(char *str)
{
    size_t 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;
    }
}