~ubuntu-branches/ubuntu/saucy/sflphone/saucy

« back to all changes in this revision

Viewing changes to sflphone-common/src/main.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Francois Marier
  • Date: 2011-04-05 14:14:13 UTC
  • mfrom: (4.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20110405141413-hbwbunfsxpn2rtre
Tags: 0.9.13-1
* New upstream release
  - remove Debian patch (applied upstream)
* Fix watch file
* Remove unnecessary versioned dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
 
107
107
    unsigned int iPid = getpid();
108
108
    char cPid[64], cOldPid[64];
109
 
    sprintf (cPid,"%d", iPid);
 
109
    snprintf (cPid, sizeof (cPid), "%d", iPid);
110
110
    std::string xdg_cache, xdg_env, path;
111
111
 
112
112
    xdg_cache = std::string (HOMEDIR) + DIR_SEPARATOR_STR + ".cache/";
118
118
    } else
119
119
        path = xdg_cache;
120
120
 
121
 
    sprintf (sfldir, "%s", path.c_str ());
 
121
    // Use safe sprintf (Contribution #4952, Brendan Smith)
 
122
    snprintf (sfldir, sizeof (sfldir), "%s", path.c_str ());
122
123
 
123
124
    path  = path + "sflphone";
124
125
 
125
 
    sprintf (homepid, "%s/%s", path.c_str (), PIDFILE);
 
126
    // Use safe sprintf (Contribution #4952, Brendan Smith)
 
127
    snprintf (homepid, sizeof (homepid), "%s/%s", path.c_str (), PIDFILE);
126
128
 
127
129
    if ( (fp = fopen (homepid,"r")) == NULL) {
128
130
        // Check if $XDG_CACHE_HOME directory exists or not.
137
139
        }
138
140
 
139
141
        // Then create the sflphone directory inside the $XDG_CACHE_HOME dir
140
 
        sprintf (sfldir, "%s", path.c_str ());
 
142
        snprintf (sfldir, sizeof (sfldir), "%s", path.c_str ());
141
143
 
142
144
        if ( (dir = opendir (sfldir)) == NULL) {
143
145
            //Create it