Simplify a debug code function.

* src/debug.c (_gpgme_debug): Remove static space string.
This commit is contained in:
Werner Koch 2013-05-06 20:22:23 +02:00
parent de30df9ce3
commit a7e5f1096f

View File

@ -258,17 +258,10 @@ _gpgme_debug (int level, const char *format, ...)
}
#ifdef FRAME_NR
{
char spaces[] = " ";
int nr_spaces = sizeof (spaces) - 1;
int nr_columns;
int indent;
nr_columns = 2 * (frame_nr - 1);
if (nr_columns > nr_spaces)
nr_columns = nr_spaces;
if (nr_columns < 0)
nr_columns = 0;
spaces[nr_columns] = '\0';
fprintf (errfp, "%s", spaces);
indent = frame_nr > 0? (2 * (frame_nr - 1)):0;
fprintf (errfp, "%*s", indent < 40? indent : 40, "");
}
#endif