Skip to content
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "fastlz"]
path = fastlz
url = https://github.com/ariya/FastLZ.git
1 change: 1 addition & 0 deletions fastlz
Submodule fastlz added at 344eb4
8 changes: 5 additions & 3 deletions fastlz.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "fastlz/fastlz.h"

Expand All @@ -16,7 +17,8 @@ compress(PyObject *self, PyObject *args, PyObject *kwargs)
PyObject *result;
const char *input;
char *output;
int level = 0, input_len, output_len;
Py_ssize_t level = 0, input_len;
uint32_t output_len;

static char *arglist[] = {"string", "level", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|i", arglist, &input,
Expand Down Expand Up @@ -62,14 +64,14 @@ decompress(PyObject *self, PyObject *args)
{
PyObject *result;
const char *input;
int input_len;
Py_ssize_t input_len;
char *output;
uint32_t output_len, decompressed_len;

if (!PyArg_ParseTuple(args, "s#", &input, &input_len))
return NULL;

if ((uint32_t)input_len < sizeof(uint32_t)) {
if (input_len < (Py_ssize_t)sizeof(uint32_t)) {
PyErr_SetString(FastlzError, "invalid input");
return NULL;
}
Expand Down
24 changes: 0 additions & 24 deletions fastlz/LICENSE

This file was deleted.

75 changes: 0 additions & 75 deletions fastlz/README.TXT

This file was deleted.

Loading