diff options
author | Kirill A. Shutemov <kirill@shutemov.name> | 2011-07-15 17:31:24 +0300 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-07-25 21:12:46 +0200 |
commit | 2ba222c5c5c406dd49492e0b5ac69d75ec997e35 (patch) | |
tree | 8fc7a866f4c91a6fdc1e52cf8d477877b7cd2a69 | |
parent | 03cdbab4105d145174176148dd0a0b6a20b02cde (diff) | |
download | libgit2-2ba222c5c5c406dd49492e0b5ac69d75ec997e35.tar.gz |
posix: declare 'buf' argument of p_write() as const
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
-rw-r--r-- | src/posix.c | 4 | ||||
-rw-r--r-- | src/posix.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/posix.c b/src/posix.c index 9dbebbd57..4bb8c3246 100644 --- a/src/posix.c +++ b/src/posix.c @@ -32,9 +32,9 @@ int p_read(git_file fd, void *buf, size_t cnt) return (int)(b - (char *)buf); } -int p_write(git_file fd, void *buf, size_t cnt) +int p_write(git_file fd, const void *buf, size_t cnt) { - char *b = buf; + const char *b = buf; while (cnt) { ssize_t r = write(fd, b, cnt); if (r < 0) { diff --git a/src/posix.h b/src/posix.h index eaa89383d..622bf8351 100644 --- a/src/posix.h +++ b/src/posix.h @@ -40,7 +40,7 @@ typedef int git_file; extern int p_open(const char *path, int flags); extern int p_creat(const char *path, int mode); extern int p_read(git_file fd, void *buf, size_t cnt); -extern int p_write(git_file fd, void *buf, size_t cnt); +extern int p_write(git_file fd, const void *buf, size_t cnt); extern int p_getcwd(char *buffer_out, size_t size); #define p_lseek(f,n,w) lseek(f, n, w) |