git.y1.nz

gbdk-2020

GameBoy Development Kit
download: https://git.y1.nz/archives/gbdk.tar.gz
README | Files | Log | Refs | LICENSE

commit 2491591610a6e22a4d0b0ad3c551340f376e4bb9
parent d58584b3e812291cbb85a862cf146ec9d5437c22
Author: bbbbbr <bbbbbr@users.noreply.github.com>
Date:   Thu,  7 Mar 2024 23:37:14 -0800

Merge pull request #631 from bbbbbr/png2asset/dash_o_empty_crash

png2asset: fix crash when filename for -o and -c not specified
Diffstat:
Mgbdk-support/png2asset/process_arguments.cpp9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/gbdk-support/png2asset/process_arguments.cpp b/gbdk-support/png2asset/process_arguments.cpp @@ -81,8 +81,8 @@ int processPNG2AssetArguments(int argc, char* argv[], PNG2AssetArguments* args) if(argc < 2) { printf("usage: png2asset <file>.png [options]\n"); - printf("-o ouput file (default: <png file>.c)\n"); - printf("-c deprecated, same as -o\n"); + printf("-o <filename> ouput file (if not used then default is <png file>.c)\n"); + printf("-c <filename> deprecated, same as -o\n"); printf("-sw <width> metasprites width size (default: png width)\n"); printf("-sh <height> metasprites height size (default: png height)\n"); printf("-sp <props> change default for sprite OAM property bytes (in hex) (default: 0x00)\n"); @@ -171,6 +171,11 @@ int processPNG2AssetArguments(int argc, char* argv[], PNG2AssetArguments* args) } else if(!strcmp(argv[i], "-c") || !strcmp(argv[i], "-o")) { + if ((i + 1) >= argc) { + printf("Error: -c or -o requires a filename, none specified\n"); + return 1; + } + args->output_filename = argv[++i]; } else if(!strcmp(argv[i], "-b"))

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.