Browse Source

jackpatch: Revert to 512 fixed array size for port and client names. But keep the jack derived value for snprintf

tags/v1.6.0
Nils 3 years ago
parent
commit
f42b8e3aac
2 changed files with 5 additions and 5 deletions
  1. +1
    -1
      CHANGELOG
  2. +4
    -4
      src/jackpatch.c

+ 1
- 1
CHANGELOG View File

@@ -19,7 +19,7 @@ Fixes and guards against trying to load non-existing sessions and creating new s
Handle various crashes-on-exit and replace them with controlled exits.
Jackpatch Version 1.0.0 (previously 0.2.0):
Jackpatch will finally not "forget" connections anymore. See #gh-74
Use actual jack reported size limits for client and port names, not just a guess.
Use actual jack reported size limits for resulting client and port names
Reduce verbosity level of log ouput.
Document 'hidden' standalone (no NSM) command line mode in --help
Handle SIGNALs even when in standalone mode


+ 4
- 4
src/jackpatch.c View File

@@ -328,8 +328,8 @@ connect_path ( struct patch_record *pr )
{
int r = 0;

char srcport[REAL_JACK_PORT_NAME_SIZE];
char dstport[REAL_JACK_PORT_NAME_SIZE];
char srcport[512]; // This should really be REAL_JACK_PORT_NAME_SIZE, but in the real world not every system and compiler does C99.
char dstport[512];

snprintf( srcport, REAL_JACK_PORT_NAME_SIZE, "%s:%s", pr->src.client, pr->src.port );
snprintf( dstport, REAL_JACK_PORT_NAME_SIZE, "%s:%s", pr->dst.client, pr->dst.port );
@@ -385,8 +385,8 @@ do_for_matching_patches ( const char *portname, void (*func)( struct patch_recor
{
struct patch_record *pr;

char client[REAL_JACK_PORT_NAME_SIZE]; //the length is technically too much. The value is client+port+1. But is guaranteed to be enough.
char port[REAL_JACK_PORT_NAME_SIZE];
char client[512]; //Linux jack limit is 64
char port[512]; //linux jack limit is 256

sscanf( portname, "%[^:]:%[^\n]", client, port );



Loading…
Cancel
Save