tools: do not segfault gimptool with source without extension.

Since commit 58fa382001, gimptool would accept source files with
non-standard extensions when using known C or C++ compilers. This would
include source with no extensions at all.
When this happens, do not try to set a pointer to a non-existing dot
separator to '\0'. That obviously segfaults.
This commit is contained in:
Jehan 2018-05-27 16:08:06 +02:00
parent 355676e7ae
commit 02fc818bf6
1 changed files with 3 additions and 2 deletions

View File

@ -498,7 +498,7 @@ do_build_2 (const gchar *cflags,
}
else
{
g_printerr ("The source file(%s) doesn't have a \"standard\" C or C++ suffix, "
g_printerr ("The source file (%s) doesn't have a \"standard\" C or C++ suffix, "
"and the tool failed to confirm the language of the file.\n"
"Please be explicit about the language of the file "
"by renaming it with one of the suffixes: .c .cc .cpp\n",
@ -507,7 +507,8 @@ do_build_2 (const gchar *cflags,
}
}
*p = '\0';
if (p)
*p = '\0';
q = strrchr (dest_exe, G_DIR_SEPARATOR);
#ifdef G_OS_WIN32
{