summaryrefslogtreecommitdiff
path: root/sys/ddb/db_elf.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-01-25 14:56:04 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-01-25 14:56:04 +0000
commit71953b628ac9e3df1ab83fefa8611b43d22dbc42 (patch)
treede8c4ee8ac2145c4145a0939a83170f11d39b9f5 /sys/ddb/db_elf.c
parentb9eb0f79c6e2d41658be29a69459c546327085c1 (diff)
Do not mix variable declaration and logic.
Diffstat (limited to 'sys/ddb/db_elf.c')
-rw-r--r--sys/ddb/db_elf.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/ddb/db_elf.c b/sys/ddb/db_elf.c
index 8d8aac80d66..92fa255e352 100644
--- a/sys/ddb/db_elf.c
+++ b/sys/ddb/db_elf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_elf.c,v 1.14 2016/01/25 14:30:30 mpi Exp $ */
+/* $OpenBSD: db_elf.c,v 1.15 2016/01/25 14:56:03 mpi Exp $ */
/* $NetBSD: db_elf.c,v 1.13 2000/07/07 21:55:18 jhawk Exp $ */
/*-
@@ -376,19 +376,18 @@ boolean_t
db_elf_line_at_pc(db_symtab_t *symtab, db_sym_t cursym, char **filename,
int *linenum, db_expr_t off)
{
- const char *linetab;
+ static char path[PATH_MAX];
+ const char *linetab, *dirname, *basename;
size_t linetab_size;
linetab = db_elf_find_linetab(symtab, &linetab_size);
if (linetab == NULL)
return (FALSE);
- const char *dirname, *basename;
if (!db_dwarf_line_at_pc(linetab, linetab_size, off,
&dirname, &basename, linenum))
return (FALSE);
- static char path[PATH_MAX];
if (dirname == NULL)
strlcpy(path, basename, sizeof(path));
else