Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix null termination in read_stream #54

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# $Id: PKGBUILD 80520 2012-11-23 18:21:28Z kkeen $
# Maintainer: Kyle Keen <[email protected]>
pkgname=jshon
pkgver=20131105
pkgver=20170302
pkgrel=1
pkgdesc="A json parser for the shell."
arch=('i686' 'x86_64')
Expand Down
4 changes: 3 additions & 1 deletion jshon.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
loadf for stdin?
*/

#define JSHONVER 20131105
#define JSHONVER 20170302

// deal with API incompatibility between jansson 1.x and 2.x
#ifndef JANSSON_MAJOR_VERSION
Expand Down Expand Up @@ -368,6 +368,8 @@ char* read_stream(FILE* fp)
(ssize_t)st.st_size, (ssize_t)bytes_r);
}

buffer[bytes_r] = 0;

return buffer;
}

Expand Down
2 changes: 1 addition & 1 deletion jshon.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: jshon
Version: 20131105
Version: 20170302
Release: 0%{?dist}
Summary: Jshon is a JSON parser designed for maximum convenience within the shell

Expand Down