Skip to content

Commit

Permalink
chore: 函数返回值不合法
Browse files Browse the repository at this point in the history
gsize是 unsigned int ,不应该返回-1

Log: 函数返回值不合法
Influence: 无
Change-Id: Ie32089641a60a80f99ee83cd422e8ce2c79629f4
  • Loading branch information
ssk-wh authored and dengbo11 committed May 30, 2023
1 parent cec4948 commit adafff4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions thumbnails/font/thumbnail.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ font_thumbnail(char* file, char* dest, int size)
{
gchar* contents;
gsize length = read_file(file, &contents);
if (length == -1) {
if (length == 0) {
return -1;
}

Expand Down Expand Up @@ -132,7 +132,7 @@ read_file(gchar* file, gchar** contents)
g_printerr("Read '%s' contents failed: %s\n",
file, error->message);
g_error_free(error);
return -1;
return 0;
}

return length;
Expand Down

0 comments on commit adafff4

Please sign in to comment.