Skip to content

Commit 40e817f

Browse files
monneratvszakats
authored andcommitted
os400: drop vsprintf() use
Follow-up to discussion in libssh2#1457 Plus e-mail address update. Closes libssh2#1462
1 parent a8bc96c commit 40e817f

10 files changed

+12
-136
lines changed

Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ OS400FILES = os400/README400 os400/initscript.sh os400/make.sh \
2929
os400/config400.default \
3030
os400/os400sys.c os400/ccsid.c \
3131
os400/libssh2_config.h os400/macros.h os400/libssh2_ccsid.h \
32-
os400/include/alloca.h os400/include/sys/socket.h os400/include/stdio.h \
32+
os400/include/alloca.h os400/include/sys/socket.h \
3333
os400/include/assert.h \
3434
os400/libssh2rpg/libssh2.rpgle.in \
3535
os400/libssh2rpg/libssh2_ccsid.rpgle.in \

os400/README400

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ additional procedures are provided for string transcoding (see below). No
1818
wrappers to standard procedures are provided: however, nested calls to
1919
transcoding procedures may be used.
2020

21-
Crypto API is provided by the IBM QC3 API library. It supports RSA, but not DSA.
21+
Crypto API is provided by the IBM QC3 API library. It supports RSA and EC,
22+
but not DSA.
2223

2324

2425
Standard compilation environment does support neither autotools nor make;
@@ -36,7 +37,8 @@ Compiling on OS/400:
3637
archive extraction. Do not ask questions about these subjects if you're not
3738
familiar with.
3839

39-
_ As a prerequisite, QADRT development environment must be installed.
40+
_ As a prerequisite, QADRT development environment >= 20211112 must be
41+
installed.
4042
For more information on downloading and installing the QADRT development kit,
4143
please see https://www.ibm.com/support/pages/node/6258183
4244
_ If data compression has to be supported, ZLIB development environment must

os400/include/alloca.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) Patrick Monnerat, D+H <patrick[email protected]>
2+
* Copyright (C) Patrick Monnerat <patrick@monnerat.net>
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms,

os400/include/stdio.h

-74
This file was deleted.

os400/include/sys/socket.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) Patrick Monnerat, D+H <patrick[email protected]>
2+
* Copyright (C) Patrick Monnerat <patrick@monnerat.net>
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms,

os400/libssh2_ccsid.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) Patrick Monnerat, D+H <patrick[email protected]>
2+
* Copyright (C) Patrick Monnerat <patrick@monnerat.net>
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms,

os400/libssh2_config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) Patrick Monnerat, D+H <patrick[email protected]>
2+
* Copyright (C) Patrick Monnerat <patrick@monnerat.net>
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms,

os400/libssh2rpg/libssh2_ccsid.rpgle.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
* Copyright (C) Patrick Monnerat, D+H <patrick[email protected]>
1+
* Copyright (C) Patrick Monnerat <patrick@monnerat.net>
22
* All rights reserved.
33
*
44
* Redistribution and use in source and binary forms,

os400/libssh2rpg/libssh2_publickey.rpgle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
* Copyright (C) Patrick Monnerat, D+H <patrick[email protected]>
1+
* Copyright (C) Patrick Monnerat <patrick@monnerat.net>
22
* All rights reserved.
33
*
44
* Redistribution and use in source and binary forms,

os400/os400sys.c

+1-53
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) Patrick Monnerat, D+H <patrick[email protected]>
2+
* Copyright (C) Patrick Monnerat <patrick@monnerat.net>
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms,
@@ -128,58 +128,6 @@ _libssh2_os400_connect(int sd, struct sockaddr *destaddr, int addrlen)
128128
}
129129

130130

131-
int
132-
_libssh2_os400_vsnprintf(char *dst, size_t len, const char *fmt, va_list args)
133-
{
134-
size_t l = 4096;
135-
int i;
136-
char *buf;
137-
138-
if(!dst || !len) {
139-
errno = EINVAL;
140-
return -1;
141-
}
142-
143-
if(l < len)
144-
l = len;
145-
146-
buf = alloca(l);
147-
148-
if(!buf) {
149-
errno = ENOMEM;
150-
return -1;
151-
}
152-
153-
/* !checksrc! disable BANNEDFUNC 1 */ /* FIXME */
154-
i = vsprintf(buf, fmt, args);
155-
156-
if(i < 0)
157-
return i;
158-
159-
if(--len > i)
160-
len = i;
161-
162-
if(len)
163-
memcpy(dst, buf, len);
164-
165-
dst[len] = '\0';
166-
return len;
167-
}
168-
169-
/* VARARGS3 */
170-
int
171-
_libssh2_os400_snprintf(char *dst, size_t len, const char *fmt, ...)
172-
{
173-
va_list args;
174-
int ret;
175-
176-
va_start(args, fmt);
177-
ret = _libssh2_os400_vsnprintf(dst, len, fmt, args);
178-
va_end(args);
179-
return ret;
180-
}
181-
182-
183131
#ifdef LIBSSH2_HAVE_ZLIB
184132
int
185133
_libssh2_os400_inflateInit_(z_streamp strm,

0 commit comments

Comments
 (0)