* mdocml: Use size_t in manpath instead of int.
@ 2012-06-08 10:32 kristaps
0 siblings, 0 replies; only message in thread
From: kristaps @ 2012-06-08 10:32 UTC (permalink / raw)
To: source
Log Message:
-----------
Use size_t in manpath instead of int.
Modified Files:
--------------
mdocml:
manpath.c
manpath.h
Revision Data
-------------
Index: manpath.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/manpath.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -Lmanpath.h -Lmanpath.h -u -p -r1.5 -r1.6
--- manpath.h
+++ manpath.h
@@ -23,7 +23,7 @@
* databases.
*/
struct manpaths {
- int sz;
+ size_t sz;
char **paths;
};
Index: manpath.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/manpath.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -Lmanpath.c -Lmanpath.c -u -p -r1.8 -r1.9
--- manpath.c
+++ manpath.c
@@ -74,7 +74,7 @@ manpath_parse(struct manpaths *dirs, con
do {
buf = mandoc_realloc(buf, bsz + 1024);
- sz = fread(buf + (int)bsz, 1, 1024, stream);
+ sz = fread(buf + bsz, 1, 1024, stream);
bsz += sz;
} while (sz > 0);
@@ -117,7 +117,7 @@ manpath_parse(struct manpaths *dirs, con
}
/* Append man.conf(5) to MANPATH. */
- if (':' == defp[(int)strlen(defp) - 1]) {
+ if (':' == defp[strlen(defp) - 1]) {
manpath_parseline(dirs, defp);
manpath_manconf(dirs, file);
return;
@@ -162,7 +162,7 @@ manpath_add(struct manpaths *dirs, const
{
char buf[PATH_MAX];
char *cp;
- int i;
+ size_t i;
if (NULL == (cp = realpath(dir, buf)))
return;
@@ -173,7 +173,7 @@ manpath_add(struct manpaths *dirs, const
dirs->paths = mandoc_realloc
(dirs->paths,
- ((size_t)dirs->sz + 1) * sizeof(char *));
+ (dirs->sz + 1) * sizeof(char *));
dirs->paths[dirs->sz++] = mandoc_strdup(cp);
}
@@ -181,7 +181,7 @@ manpath_add(struct manpaths *dirs, const
void
manpath_free(struct manpaths *p)
{
- int i;
+ size_t i;
for (i = 0; i < p->sz; i++)
free(p->paths[i]);
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-06-08 10:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-08 10:32 mdocml: Use size_t in manpath instead of int kristaps
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).