SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi. I tried to build cups-bjnp-2.0.1 via SBo, like this
Code:
cd /tmp
wget https://slackbuilds.org/slackbuilds/14.2/system/cups-bjnp.tar.gz -P /tmp
tar xf cups-bjnp.tar.gz
cd /tmp/cups-bjnp && curl -O https://netix.dl.sourceforge.net/project/cups-bjnp/cups-bjnp/2.0.1/cups-bjnp-2.0.1.tar.gz
sed -i 's|-1.2|-2.0.1|' /tmp/cups-bjnp/cups-bjnp.SlackBuild
./cups-bjnp.SlackBuild
but I have this error:
Code:
bjnp-commands.c: In function «bjnp_set_command_header»:
bjnp-commands.c:40:5: error: «strncpy» output truncated before terminating nul copying 4 bytes from a string of the same length [-Werror=stringop-truncation]
strncpy(cmd->header.BJNP_id, BJNP_STRING, sizeof(cmd->header.BJNP_id));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bjnp-commands.c is have code with this line:
Code:
static void
bjnp_set_command_header(uint8_t dev_type, uint16_t seq_no, uint16_t session_id, bjnp_command_t *cmd, char cmd_code,
int command_len)
{
/*
* Set command buffer with command code, session_id and lenght of payload
* Returns: sequence number of command
*/
strncpy(cmd->header.BJNP_id, BJNP_STRING, sizeof(cmd->header.BJNP_id));
cmd->header.dev_type = dev_type;
cmd->header.cmd_code = cmd_code;
cmd->header.unknown1 = htons(0);
cmd->header.payload_len = htonl(command_len - bjnp_header_size);
cmd->header.seq_no = htons(seq_no);
cmd->header.session_id = htons(session_id);
}
How it can be fixed?
Thanks
Last edited by TurboBlaze; 04-20-2019 at 01:42 PM.
Reason: solved
I tried this on my 14.2 system and I was able to compile it correctly.
Code:
wget https://slackbuilds.org/slackbuilds/14.2/system/cups-bjnp.tar.gz
tar xvf cups-bjnp.tar.gz
sed -i 's|-1.2|-2.0.1|g' cups.*
. cups.info
wget $DOWNLOAD
sh cups-bjnp.SlackBuild
bassmadrigal, thanks for your answer.
Probably you are use ./ap/cups-2.1.4-x86_64-1.txz
but I use ./ap/cups-2.2.11-x86_64-1.txz from Slackware64-current.
You're correct, I did try it with the stock cups from 14.2. I then grabbed the source from -current for cups and upgraded my cups to that version (I don't have a printed hooked up, so I'm not worried about breakage, and if something unexpected does break, I can reinstall the stock package). I then rebuilt cups-bjnp v2.0.1 and it worked fine.
I'm not sure if you have a full -current install or have just upgraded occasional packages on 14.2 like me...
Otherwise, you can likely bypass this warning-gone-error by adding -Wno-stringop-truncation to the CFLAGS variable in the SlackBuild.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.