56 |
/* Converts binary value V into printable form in the exactly |
/* Converts binary value V into printable form in the exactly |
57 |
FP->W character in buffer S according to format specification |
FP->W character in buffer S according to format specification |
58 |
FP. No null terminator is appended to the buffer. */ |
FP. No null terminator is appended to the buffer. */ |
59 |
void |
bool |
60 |
data_out (char *s, const struct fmt_spec *fp, const union value *v) |
data_out (char *s, const struct fmt_spec *fp, const union value *v) |
61 |
{ |
{ |
62 |
int cat = formats[fp->type].cat; |
int cat = formats[fp->type].cat; |
73 |
{ |
{ |
74 |
memset (s, ' ', fp->w); |
memset (s, ' ', fp->w); |
75 |
s[fp->w - fp->d - 1] = '.'; |
s[fp->w - fp->d - 1] = '.'; |
76 |
return; |
return true; |
77 |
} |
} |
78 |
|
|
79 |
/* Handle decimal shift. */ |
/* Handle decimal shift. */ |
189 |
/* Error handling. */ |
/* Error handling. */ |
190 |
if (!ok) |
if (!ok) |
191 |
strncpy (s, "ERROR", fp->w); |
strncpy (s, "ERROR", fp->w); |
192 |
|
|
193 |
|
return ok; |
194 |
} |
} |
195 |
|
|
196 |
/* Converts V into S in F format with width W and D decimal places, |
/* Converts V into S in F format with width W and D decimal places, |