Move filename_from_filepath() to filenames.c

This commit is contained in:
jsteube
2016-09-08 16:17:28 +02:00
parent 18534fcdeb
commit 367473c657
3 changed files with 22 additions and 18 deletions
+20
View File
@@ -73,3 +73,23 @@ void generate_cached_kernel_amp_filename (const uint attack_kern, char *profile_
{
snprintf (cached_file, 255, "%s/kernels/amp_a%d.%s.kernel", profile_dir, attack_kern, device_name_chksum);
}
char *filename_from_filepath (char *filepath)
{
char *ptr = NULL;
if ((ptr = strrchr (filepath, '/')) != NULL)
{
ptr++;
}
else if ((ptr = strrchr (filepath, '\\')) != NULL)
{
ptr++;
}
else
{
ptr = filepath;
}
return ptr;
}
-18
View File
@@ -1360,25 +1360,7 @@ static void hc_signal (void (callback) (int))
*/
static char *filename_from_filepath (char *filepath)
{
char *ptr = NULL;
if ((ptr = strrchr (filepath, '/')) != NULL)
{
ptr++;
}
else if ((ptr = strrchr (filepath, '\\')) != NULL)
{
ptr++;
}
else
{
ptr = filepath;
}
return ptr;
}
static uint convert_from_hex (char *line_buf, const uint line_len)
{