mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 22:03:03 +01:00
Commit fix from Stephen Boyd for his RMCOBOL interface library.
This commit is contained in:
parent
f1c264cfe4
commit
64bfb9e026
@ -1521,7 +1521,7 @@ EXPORT RM_ENTRY(rmc_ftoc)
|
|||||||
|
|
||||||
// Convert a Cobol alpha (PIC X) field to a C string. This is done by trimming trailing spaces
|
// Convert a Cobol alpha (PIC X) field to a C string. This is done by trimming trailing spaces
|
||||||
// and adding the trailing '\0'.
|
// and adding the trailing '\0'.
|
||||||
EXPORT RM_ENTRY(rmc_ctos)
|
EXPORT RM_ENTRY(rmc_stoc)
|
||||||
{
|
{
|
||||||
char* dest = (char*) arg_vector[-1].a_address;
|
char* dest = (char*) arg_vector[-1].a_address;
|
||||||
const int dlen = arg_vector[-1].a_length;
|
const int dlen = arg_vector[-1].a_length;
|
||||||
@ -1541,12 +1541,12 @@ EXPORT RM_ENTRY(rmc_ctos)
|
|||||||
|
|
||||||
// Convert a C string to a Cobol alpha (PIC X) field. This is done by copying the original
|
// Convert a C string to a Cobol alpha (PIC X) field. This is done by copying the original
|
||||||
// string and padding on the right with spaces.
|
// string and padding on the right with spaces.
|
||||||
EXPORT RM_ENTRY(rmc_stoc)
|
EXPORT RM_ENTRY(rmc_ctos)
|
||||||
{
|
{
|
||||||
char* dest = (char*) arg_vector[-1].a_address;
|
char* dest = (char*) arg_vector[-1].a_address;
|
||||||
const int dlen = arg_vector[-1].a_length;
|
const int dlen = arg_vector[-1].a_length;
|
||||||
const char* src = (char*) arg_vector[0].a_address;
|
const char* src = (char*) arg_vector[0].a_address;
|
||||||
const int slen = arg_vector[0].a_length;
|
const int slen = strlen(src);
|
||||||
|
|
||||||
memset(dest, ' ', dlen);
|
memset(dest, ' ', dlen);
|
||||||
int len = (slen <= dlen) ? slen : dlen;
|
int len = (slen <= dlen) ? slen : dlen;
|
||||||
@ -1554,10 +1554,8 @@ EXPORT RM_ENTRY(rmc_stoc)
|
|||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char* banner = "Firebird Embedded SQL Interface";
|
static char* banner = "Firebird Embedded SQL Interface";
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user