-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.c
More file actions
23 lines (20 loc) · 1.13 KB
/
utils.c
File metadata and controls
23 lines (20 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* utils.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: abdsalah <abdsalah@student.42amman.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/02/06 18:17:54 by abdsalah #+# #+# */
/* Updated: 2026/02/06 18:17:58 by abdsalah ### ########.fr */
/* */
/* ************************************************************************** */
#include "mfa.h"
bool endswith(const char *str, const char *suffix)
{
size_t str_len = strlen(str);
size_t suffix_len = strlen(suffix);
if (suffix_len > str_len)
return (false);
return (strcmp(str + str_len - suffix_len, suffix) == 0);
}