summaryrefslogtreecommitdiff
path: root/libps/spec.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-03-21 02:21:14 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-03-21 02:21:14 +0000
commit5245408b65d8ae94c156c56c7f36417adac95ee4 (patch)
tree0e2b2e55cb9166bf10178dccc7b575ea7612f7e5 /libps/spec.c
parent2e4ed01f888459b45f04352115703d72af272cc0 (diff)
Include <string.h>.
(ps_emit_num_blocks): Use int format for int arg. (sprint_frac_value): Likewise.
Diffstat (limited to 'libps/spec.c')
-rw-r--r--libps/spec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libps/spec.c b/libps/spec.c
index 90689300..52696e7c 100644
--- a/libps/spec.c
+++ b/libps/spec.c
@@ -24,6 +24,7 @@
#include <assert.h>
#include <pwd.h>
#include <hurd/resource.h>
+#include <string.h>
#include "ps.h"
#include "common.h"
@@ -300,7 +301,7 @@ ps_emit_num_blocks(proc_stat_t ps, ps_getter_t getter, int width, FILE
*stream, int *count)
{
char buf[20];
- sprintf(buf, "%ld", G(getter, int)(ps) / 1024);
+ sprintf(buf, "%d", G(getter, int)(ps) / 1024);
return ps_write_field(buf, width, stream, count);
}
@@ -329,9 +330,9 @@ sprint_frac_value(char *buf,
frac /= 10;
if (frac_len > 0)
- sprintf(buf, "%ld.%0*ld", value, frac_len, frac);
+ sprintf(buf, "%d.%0*d", value, frac_len, frac);
else
- sprintf(buf, "%ld", value);
+ sprintf(buf, "%d", value);
return strlen(buf);
}