(get_first_editor_line): minor refactoring.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2012-10-10 12:52:22 +04:00
parent 8883273bdd
commit 7f7a75f988
1 changed files with 14 additions and 10 deletions

View File

@ -1386,15 +1386,16 @@ edit_read_syntax_file (WEdit * edit, char ***pnames, const char *syntax_file,
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
static char * static const char *
get_first_editor_line (WEdit * edit) get_first_editor_line (WEdit * edit)
{ {
size_t i;
static char s[256]; static char s[256];
s[0] = '\0'; s[0] = '\0';
if (edit == NULL)
return s; if (edit != NULL)
{
size_t i;
for (i = 0; i < sizeof (s) - 1; i++) for (i = 0; i < sizeof (s) - 1; i++)
{ {
@ -1405,7 +1406,10 @@ get_first_editor_line (WEdit * edit)
break; break;
} }
} }
s[sizeof (s) - 1] = '\0'; s[sizeof (s) - 1] = '\0';
}
return s; return s;
} }