{
char *p;
- if (*LDAP_DIRSEP != '/')
- {
- for (p = url; *p; p++)
- {
+ if (*LDAP_DIRSEP != '/') {
+ for (p = url; *p; p++) {
if (*p == *LDAP_DIRSEP)
*p = '/';
}
{
int tmpfd;
/* write value to file */
- sprintf( tmpfname, "%s" LDAP_DIRSEP "ldapsearch-%s-XXXXXX",
+ snprintf( tmpfname, sizeof tmpfname,
+ "%s" LDAP_DIRSEP "ldapsearch-%s-XXXXXX",
tmpdir, a );
tmpfp = NULL;
fclose( tmpfp );
- sprintf( url, "%s%s", urlpre,
+ snprintf( url, sizeof url, "%s%s", urlpre,
&tmpfname[strlen(tmpdir) + sizeof(LDAP_DIRSEP) - 1] );
urlize( url );
*/
sanum = 0;
- sprintf( scmd, "%s%s%s", progdir, LDAP_DIRSEP, SEARCHCMD );
+ snprintf( scmd, sizeof scmd, "%s" LDAP_DIRSEP SEARCHCMD,
+ progdir );
sargs[sanum++] = scmd;
sargs[sanum++] = "-h";
sargs[sanum++] = host;
*/
ranum = 0;
- sprintf( rcmd, "%s%s%s", progdir, LDAP_DIRSEP, READCMD );
+ snprintf( rcmd, sizeof rcmd, "%s" LDAP_DIRSEP READCMD,
+ progdir );
rargs[ranum++] = rcmd;
rargs[ranum++] = "-h";
rargs[ranum++] = host;
*/
aanum = 0;
- sprintf( acmd, "%s%s%s", progdir, LDAP_DIRSEP, ADDCMD );
+ snprintf( acmd, sizeof acmd, "%s" LDAP_DIRSEP ADDCMD,
+ progdir );
aargs[aanum++] = acmd;
aargs[aanum++] = "-h";
aargs[aanum++] = host;
{
char buf[MAXPATHLEN];
- sprintf( buf, "%s%s%s", dirname, LDAP_DIRSEP, filename );
+ snprintf( buf, sizeof buf, "%s" LDAP_DIRSEP "%s",
+ dirname, filename );
return( strdup( buf ));
}