dotnfc / libnfc

Automatically exported from code.google.com/p/libnfc
GNU Lesser General Public License v3.0
1 stars 0 forks source link

libnfc uses exit() but should not exit the application #220

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Detected by lintian(1) on Debian:

X: libnfc4: shlib-calls-exit usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0
N: 
N:    The listed shared library calls the C library exit() or _exit()
N:    functions.
N:    
N:    In the case of an error, the library should instead return an
N:    appropriate error code to the calling program which can then determine
N:    how to handle the error, including performing any required clean-up.
N:    
N:    In most cases, removing the call should be discussed with upstream,
N:    particularly as it may produce an ABI change.
N:    
N:    Severity: wishlist, Certainty: possible
N:    
N:    Check: shared-libs, Type: binary, udeb

The library should return an error code instead of forcing an application exit. 
This is bad programming (but I did the same error in another project :-) )

Example of code with the problem:
void
nfc_init(nfc_context **context)
{
  if (!context) {
    printf("Error: NULL context is not supported anymore, please fix your code.\n");
    exit(EXIT_FAILURE);
  }
  *context = nfc_context_new();
}

Original issue reported on code.google.com by ludovic....@gmail.com on 25 Jan 2013 at 1:49

GoogleCodeExporter commented 9 years ago

Original comment by romu...@libnfc.org on 28 Jan 2013 at 12:49

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 4b97700352bc.

Original comment by romu...@libnfc.org on 28 Jan 2013 at 12:58