~ubuntu-branches/debian/jessie/smstools/jessie

« back to all changes in this revision

Viewing changes to src/cfgfile.c

  • Committer: Bazaar Package Importer
  • Author(s): Jan Wagner
  • Date: 2010-06-21 10:19:52 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20100621101952-pz5h5zctan8vumbi
Tags: 3.1.10-0.1
* Non-maintainer upload, as requested by maintainer
* New Upstream version (Closes: #586643)
* Bump Standards to 3.8.4, no changes needed
* Define source format 1.0 in debian/source/format
* Add $remote_fs as dependency for Required-Start and Required-Stop in the
  init script, removed $local_fs, which is implicit

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
  //if (cp!=0)
29
29
  //  *cp=0;
30
30
  while (is_blank(*text))
31
 
    strcpy(text, text +1);
 
31
    memmove(text, text +1, strlen(text +1) +1);
32
32
  if (*text == '#')
33
33
    *text = 0;
34
34
 
49
49
  int j;
50
50
  char* cp;
51
51
  char* cp2;
52
 
  int size;
 
52
  int len;
53
53
 
54
54
  cp=(char*)parameter;
55
55
  subparam[0]=0;
61
61
  }
62
62
  cp2=strchr(cp,delim);
63
63
  if (cp2)
64
 
    size=cp2-cp;
 
64
    len=cp2-cp;
65
65
  else
66
 
    size=strlen(cp);
67
 
  strncpy(subparam,cp,size);
68
 
  subparam[size]=0;
 
66
    len=strlen(cp);
 
67
 
 
68
  // 3.1.7: size_subparam was not used.
 
69
  if (len >= size_subparam)
 
70
    return 0;
 
71
 
 
72
  strncpy(subparam,cp,len);
 
73
  subparam[len]=0;
69
74
  cutspaces(subparam);
 
75
 
 
76
  // 3.1.7:
 
77
  if (!(*subparam))
 
78
    return 0;
 
79
 
70
80
  return 1;
71
81
}
72
82