chiark
/
gitweb
/
~mdw
/
mLib
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Always add a terminating null, and don't count it in the length.
[mLib]
/
lbuf.h
diff --git
a/lbuf.h
b/lbuf.h
index 3f25dacefd6c9da869ed1dc1854a5c9c32706bc2..9f290b808538d05610cd5f70175b7cd12de9a5cf 100644
(file)
--- a/
lbuf.h
+++ b/
lbuf.h
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: lbuf.h,v 1.
4 2000/06/17 10:38:14
mdw Exp $
+ * $Id: lbuf.h,v 1.
5 2001/01/20 12:06:01
mdw Exp $
*
* Block-to-line buffering
*
*
* Block-to-line buffering
*
@@
-30,6
+30,9
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: lbuf.h,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: lbuf.h,v $
+ * Revision 1.5 2001/01/20 12:06:01 mdw
+ * Define flags with macros, to ensure unsignedness.
+ *
* Revision 1.4 2000/06/17 10:38:14 mdw
* Add support for variable buffer sizes.
*
* Revision 1.4 2000/06/17 10:38:14 mdw
* Add support for variable buffer sizes.
*
@@
-119,10
+122,8
@@
typedef struct lbuf {
char *buf; /* The actual buffer */
} lbuf;
char *buf; /* The actual buffer */
} lbuf;
-enum {
- LBUF_CR = 1, /* Read a carriage return */
- LBUF_ENABLE = 2 /* Buffer is currently enabled */
-};
+#define LBUF_CR 1u /* Read a carriage return */
+#define LBUF_ENABLE 2u /* Buffer is currently enabled */
/*----- Functions provided ------------------------------------------------*/
/*----- Functions provided ------------------------------------------------*/