Fix null pointer deref when environment variable doesn't exist. (#16)

* Fix null pointer deref when environment variable doesn't exist. Causes cpp to crash every time

* Remove lines per Ethan

* Add cpp to release archive

* This isn't docker wanting a file list :P
This commit is contained in:
Lightning 2021-10-25 08:55:37 -07:00 committed by GitHub
parent feb59f3cbd
commit f02826c5a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 19 deletions

View File

@ -55,25 +55,7 @@ jobs:
shell: bash
run: |
cp xgcc gcc
tar -cf ${{ matrix.TARGET.ARCHIVE_NAME }} cc1 gcc cc1plus g++
- name: Clean
shell: bash
run: |
make clean
- name: Configure for mips
shell: bash
run: |
./configure --target=mips --prefix=/opt/cross --with-gnu-as --disable-gprof --disable-gdb --disable-werror --host=${{ matrix.TARGET.HOST }} --build=${{ matrix.TARGET.HOST }}
- name: Make cpp
continue-on-error: true
shell: bash
run: |
make cpp CFLAGS="${{ matrix.TARGET.CFLAGS }}"
- name: Add cpp to release archive
shell: bash
run: |
tar -uf ${{ matrix.TARGET.ARCHIVE_NAME }} cpp
gzip -9 ${{ matrix.TARGET.ARCHIVE_NAME }}
tar -cf ${{ matrix.TARGET.ARCHIVE_NAME }} cc1 gcc cc1plus g++ cpp
- name: Upload archive
uses: actions/upload-artifact@v2
with:

5
cccp.c
View File

@ -1172,6 +1172,11 @@ kanjienv_check ()
{
char *n64kanji_env;
n64kanji_env = getenv("N64GCC_KANJI");
if ( !n64kanji_env ) {
n64kanji_flag = KANJI_OFF;
return;
}
if ( !strcasecmp( n64kanji_env, "SJIS" ) ) {
n64kanji_flag = KANJI_SJIS;
} else if ( !strcasecmp( n64kanji_env, "EUC" ) ) {