mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
Emit meaningful error messages
That is useful, even if this is only an internal tool. I have been scratching my head why this tool would break distcheck...
This commit is contained in:
parent
77ebf9bfc5
commit
de0d7a335c
@ -26,12 +26,19 @@ main (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
char *content;
|
char *content;
|
||||||
int i;
|
int i;
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
if (argc != 3)
|
if (argc != 3)
|
||||||
return 1;
|
{
|
||||||
|
g_printerr ("Usage: data-to-c <filename> <variable>");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (!g_file_get_contents (argv[1], &content, NULL, NULL))
|
if (!g_file_get_contents (argv[1], &content, NULL, &error))
|
||||||
return 1;
|
{
|
||||||
|
g_printerr ("%s", error->message);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
g_print ("const char %s[] = \"", argv[2]);
|
g_print ("const char %s[] = \"", argv[2]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user