diff --git a/output/outelf32.c b/output/outelf32.c index e810198c..4489d401 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -1595,7 +1595,7 @@ static void stabs32_generate(void) * the source-file, the n_desc field should be set to the number * of remaining stabs */ - WRITE_STAB(sptr, fileidx[0], 0, 0, 0, strlen(allfiles[0] + 12)); + WRITE_STAB(sptr, fileidx[0], 0, 0, 0, stabstrlen); /* this is the stab for the main source file */ WRITE_STAB(sptr, fileidx[mainfileindex], N_SO, 0, 0, 0); diff --git a/output/outelf64.c b/output/outelf64.c index 19bd8459..41243b1e 100644 --- a/output/outelf64.c +++ b/output/outelf64.c @@ -1682,7 +1682,7 @@ static void stabs64_generate(void) * the source-file, the n_desc field should be set to the number * of remaining stabs */ - WRITE_STAB(sptr, fileidx[0], 0, 0, 0, strlen(allfiles[0] + 12)); + WRITE_STAB(sptr, fileidx[0], 0, 0, 0, stabstrlen); /* this is the stab for the main source file */ WRITE_STAB(sptr, fileidx[mainfileindex], N_SO, 0, 0, 0); diff --git a/output/outelfx32.c b/output/outelfx32.c index a9b6957a..3eeb224f 100644 --- a/output/outelfx32.c +++ b/output/outelfx32.c @@ -1641,7 +1641,7 @@ static void stabsx32_generate(void) * the source-file, the n_desc field should be set to the number * of remaining stabs */ - WRITE_STAB(sptr, fileidx[0], 0, 0, 0, strlen(allfiles[0] + 12)); + WRITE_STAB(sptr, fileidx[0], 0, 0, 0, stabstrlen); /* this is the stab for the main source file */ WRITE_STAB(sptr, fileidx[mainfileindex], N_SO, 0, 0, 0);