Skip to content

'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] #139

Description

@gokulprathin8

warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]

Occurs at:

int _go_registerDriver(const char *driver, const char *prefix) {
	char *fnname = (char*)calloc(1,strlen(driver)+strlen(prefix)+1);
	sprintf(fnname,"%s%s",prefix,driver);     <------------------------------
	void *fcn = dlsym(RTLD_DEFAULT,fnname);
	free(fnname);
	if (fcn != nullptr) {
		fn_def fnptr = (fn_def)fcn;
		fnptr();
	} else {
		return 1;
	}
	return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions