Hi Abhilash,

I am not an expert in this area and hence would leave others to comment on the 
accuracy of the code changes, I have some minor comments on the coding style 

dns.c

1.  Line 257 
The bracket needs to be on the same column as the "if" on line 252

2. All statement continuations should start after 4 spaces and not a tab. 
This is seen on multiple lines

For example

240         rc = scds_get_ext_property(handle, user, SCHA_PTYPE_STRING,
241                 &user_name_st);

On Line 241, you have used a tab instead of 4 spaces.

It should look like 

240         rc = scds_get_ext_property(handle, user, SCHA_PTYPE_STRING,
241             &user_name_st);
 
Taking a more indepth look, I see this problem even in existing code. So I 
guess you may ignore this.

3. Lines 252 - 257
Your single statement on line 253 spans over the remianing lines. If you choose 
to ignore point 2 above, you still need to allign lines 255, 256 with 254

The original code is 

252                         if (print_messages) {
253                                 (void) fprintf(stderr,
254                                         gettext("Data buffer for user %s "
255                                                 "is not big enough.\n"),
256                                                 user_name_st->val.val_str);

The revamped code 

252                         if (print_messages) {
253                                 (void) fprintf(stderr,
254                                         gettext("Data buffer for user %s "
255                                         "is not big enough.\n"),
256                                         user_name_st->val.val_str);

If you are going to follow point 2, then 

252                         if (print_messages) {
253                                 (void) fprintf(stderr,
254                                     gettext("Data buffer for user %s "
255                                     "is not big enough.\n"),
256                                     user_name_st->val.val_str);

4. Continuation lines need to be indented by 4 space

556                 scds_syslog(LOG_ERR,
557                 "Failed to retrieve the extension property %s: %s.",
558                 user, scds_error_string(rc));

Needs to be changed to 

556                 scds_syslog(LOG_ERR,
557                     "Failed to retrieve the extension property %s: %s.",
558                     user, scds_error_string(rc));

5. Line 562
Since you are ignoring the return value, cast it to void else lint will complain

562         strcpy(user_name, user_name_st->val.val_str);

needs to be changed to 

562         (void) strcpy(user_name, user_name_st->val.val_str);

Thanks,
Tirthankar
-- 
This message posted from opensolaris.org

Reply via email to