Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
e911e954
...
e911e9546240c128f1dcf33f1a6abda7e223a182
authored
2002-11-04 17:32:27 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(print_string): Pad right if necessary.
1 parent
3210a3a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
12 deletions
mh/mh_format.c
mh/mh_format.c
View file @
e911e95
...
...
@@ -165,26 +165,36 @@ compress_ws (char *str, size_t *size)
/* Print len bytes from str into mach->outbuf */
static
void
print_string
(
struct
mh_machine
*
mach
,
size_t
width
,
char
*
str
,
size_t
len
)
print_string
(
struct
mh_machine
*
mach
,
size_t
width
,
char
*
str
,
size_t
fmt
len
)
{
size_t
rest
;
size_t
rest
,
len
;
if
(
!
str
)
{
str
=
""
;
len
=
0
;
}
str
=
""
;
rest
=
strlen
(
str
);
if
(
len
>
rest
)
len
=
rest
;
if
(
!
width
)
width
=
mach
->
width
;
rest
=
mach
->
width
-
mach
->
ind
;
len
=
strlen
(
str
);
rest
=
width
-
mach
->
ind
;
if
(
len
>
rest
)
len
=
rest
;
{
if
(
fmtlen
>=
len
)
fmtlen
=
rest
;
len
=
rest
;
}
if
(
fmtlen
<
len
)
len
=
fmtlen
;
memcpy
(
mach
->
outbuf
+
mach
->
ind
,
str
,
len
);
mach
->
ind
+=
len
;
if
(
fmtlen
>
len
)
{
fmtlen
-=
len
;
memset
(
mach
->
outbuf
+
mach
->
ind
,
' '
,
fmtlen
);
mach
->
ind
+=
fmtlen
;
}
}
static
void
...
...
Please
register
or
sign in
to post a comment